···294294{295295}296296297297-/*298298- * This is called after a mode is programmed. It should reverse anything done299299- * by the prepare function300300- */301301-static void cirrus_crtc_commit(struct drm_crtc *crtc)302302-{303303-}304304-305305-/*306306- * The core can pass us a set of gamma values to program. We actually only307307- * use this for 8-bit mode so can't perform smooth fades on deeper modes,308308- * but it's a requirement that we provide the function309309- */310310-static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,311311- u16 *blue, uint32_t size,312312- struct drm_modeset_acquire_ctx *ctx)297297+static void cirrus_crtc_load_lut(struct drm_crtc *crtc)313298{314299 struct drm_device *dev = crtc->dev;315300 struct cirrus_device *cdev = dev->dev_private;···302317 int i;303318304319 if (!crtc->enabled)305305- return 0;320320+ return;306321307322 r = crtc->gamma_store;308323 g = r + crtc->gamma_size;···315330 WREG8(PALETTE_DATA, *g++ >> 8);316331 WREG8(PALETTE_DATA, *b++ >> 8);317332 }333333+}334334+335335+/*336336+ * This is called after a mode is programmed. It should reverse anything done337337+ * by the prepare function338338+ */339339+static void cirrus_crtc_commit(struct drm_crtc *crtc)340340+{341341+ cirrus_crtc_load_lut(crtc);342342+}343343+344344+/*345345+ * The core can pass us a set of gamma values to program. We actually only346346+ * use this for 8-bit mode so can't perform smooth fades on deeper modes,347347+ * but it's a requirement that we provide the function348348+ */349349+static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,350350+ u16 *blue, uint32_t size,351351+ struct drm_modeset_acquire_ctx *ctx)352352+{353353+ cirrus_crtc_load_lut(crtc);318354319355 return 0;320356}