diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2018-01-31 06:04:50 -0500 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-01-31 07:14:33 -0500 |
commit | 745fd50f3b044db6a3922e1718306555613164b0 (patch) | |
tree | f189465714896c0ab6f2df6bf35ba5496fecbd8e | |
parent | 17b11b76b87afe9f8be199d7a5f442497133e2b0 (diff) |
drm/cirrus: Load lut in crtc_commit
In the past the ast driver relied upon the fbdev emulation helpers to
call ->load_lut at boot-up. But since
commit b8e2b0199cc377617dc238f5106352c06dcd3fa2
Author: Peter Rosin <peda@axentia.se>
Date: Tue Jul 4 12:36:57 2017 +0200
drm/fb-helper: factor out pseudo-palette
that's cleaned up and drivers are expected to boot into a consistent
lut state. This patch fixes that.
Fixes: b8e2b0199cc3 ("drm/fb-helper: factor out pseudo-palette")
Cc: Peter Rosin <peda@axenita.se>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: <stable@vger.kernel.org> # v4.14+
References: https://bugzilla.kernel.org/show_bug.cgi?id=198123
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20180131110450.22153-1-daniel.vetter@ffwll.ch
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | drivers/gpu/drm/cirrus/cirrus_mode.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c index cd23b1b28259..c91b9b054e3f 100644 --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c | |||
@@ -294,22 +294,7 @@ static void cirrus_crtc_prepare(struct drm_crtc *crtc) | |||
294 | { | 294 | { |
295 | } | 295 | } |
296 | 296 | ||
297 | /* | 297 | static void cirrus_crtc_load_lut(struct drm_crtc *crtc) |
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) | ||
313 | { | 298 | { |
314 | struct drm_device *dev = crtc->dev; | 299 | struct drm_device *dev = crtc->dev; |
315 | struct cirrus_device *cdev = dev->dev_private; | 300 | struct cirrus_device *cdev = dev->dev_private; |
@@ -317,7 +302,7 @@ static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, | |||
317 | int i; | 302 | int i; |
318 | 303 | ||
319 | if (!crtc->enabled) | 304 | if (!crtc->enabled) |
320 | return 0; | 305 | return; |
321 | 306 | ||
322 | r = crtc->gamma_store; | 307 | r = crtc->gamma_store; |
323 | g = r + crtc->gamma_size; | 308 | g = r + crtc->gamma_size; |
@@ -330,6 +315,27 @@ static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, | |||
330 | WREG8(PALETTE_DATA, *g++ >> 8); | 315 | WREG8(PALETTE_DATA, *g++ >> 8); |
331 | WREG8(PALETTE_DATA, *b++ >> 8); | 316 | WREG8(PALETTE_DATA, *b++ >> 8); |
332 | } | 317 | } |
318 | } | ||
319 | |||
320 | /* | ||
321 | * This is called after a mode is programmed. It should reverse anything done | ||
322 | * by the prepare function | ||
323 | */ | ||
324 | static void cirrus_crtc_commit(struct drm_crtc *crtc) | ||
325 | { | ||
326 | cirrus_crtc_load_lut(crtc); | ||
327 | } | ||
328 | |||
329 | /* | ||
330 | * The core can pass us a set of gamma values to program. We actually only | ||
331 | * use this for 8-bit mode so can't perform smooth fades on deeper modes, | ||
332 | * but it's a requirement that we provide the function | ||
333 | */ | ||
334 | static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, | ||
335 | u16 *blue, uint32_t size, | ||
336 | struct drm_modeset_acquire_ctx *ctx) | ||
337 | { | ||
338 | cirrus_crtc_load_lut(crtc); | ||
333 | 339 | ||
334 | return 0; | 340 | return 0; |
335 | } | 341 | } |