Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'drm-misc-fixes-2018-01-31' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

- fix lut loading for cirrus

* tag 'drm-misc-fixes-2018-01-31' of git://anongit.freedesktop.org/drm/drm-misc:
drm/cirrus: Load lut in crtc_commit

+23 -17
+23 -17
drivers/gpu/drm/cirrus/cirrus_mode.c
··· 294 294 { 295 295 } 296 296 297 - /* 298 - * This is called after a mode is programmed. It should reverse anything done 299 - * by the prepare function 300 - */ 301 - static void cirrus_crtc_commit(struct drm_crtc *crtc) 302 - { 303 - } 304 - 305 - /* 306 - * The core can pass us a set of gamma values to program. We actually only 307 - * use this for 8-bit mode so can't perform smooth fades on deeper modes, 308 - * but it's a requirement that we provide the function 309 - */ 310 - static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, 311 - u16 *blue, uint32_t size, 312 - struct drm_modeset_acquire_ctx *ctx) 297 + static void cirrus_crtc_load_lut(struct drm_crtc *crtc) 313 298 { 314 299 struct drm_device *dev = crtc->dev; 315 300 struct cirrus_device *cdev = dev->dev_private; ··· 302 317 int i; 303 318 304 319 if (!crtc->enabled) 305 - return 0; 320 + return; 306 321 307 322 r = crtc->gamma_store; 308 323 g = r + crtc->gamma_size; ··· 315 330 WREG8(PALETTE_DATA, *g++ >> 8); 316 331 WREG8(PALETTE_DATA, *b++ >> 8); 317 332 } 333 + } 334 + 335 + /* 336 + * This is called after a mode is programmed. It should reverse anything done 337 + * by the prepare function 338 + */ 339 + static void cirrus_crtc_commit(struct drm_crtc *crtc) 340 + { 341 + cirrus_crtc_load_lut(crtc); 342 + } 343 + 344 + /* 345 + * The core can pass us a set of gamma values to program. We actually only 346 + * use this for 8-bit mode so can't perform smooth fades on deeper modes, 347 + * but it's a requirement that we provide the function 348 + */ 349 + static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, 350 + u16 *blue, uint32_t size, 351 + struct drm_modeset_acquire_ctx *ctx) 352 + { 353 + cirrus_crtc_load_lut(crtc); 318 354 319 355 return 0; 320 356 }