diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-07-29 17:38:21 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-08-02 09:57:56 +0900 |
commit | 8bb9d460fbc82ee5d6f87e1d11cfa52f4f3072ee (patch) | |
tree | 958498f4509ab689f7cba2f5da9ed77f6d118f3f | |
parent | c833c0866f2f8f829185667efe3d6dfa5979a9e8 (diff) |
xfree86/modes: Handle no palette case better in xf86RandR12CrtcSetGammafor-master
Just use the RandR gamma ramp directly.
Fixes random on-monitor colours with drivers which don't call
xf86HandleColormaps, e.g. modesetting.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97154
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | hw/xfree86/modes/xf86RandR12.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 1e9cbd33c..b13612371 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -1310,9 +1310,17 @@ xf86RandR12CrtcSetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc) if (randrp->palette_size) { xf86RandR12CrtcComputeGamma(pScreen, randr_crtc); - xf86RandR12CrtcReloadGamma(randr_crtc); + } else { + memcpy(crtc->gamma_red, randr_crtc->gammaRed, + crtc->gamma_size * sizeof(crtc->gamma_red[0])); + memcpy(crtc->gamma_green, randr_crtc->gammaGreen, + crtc->gamma_size * sizeof(crtc->gamma_green[0])); + memcpy(crtc->gamma_blue, randr_crtc->gammaBlue, + crtc->gamma_size * sizeof(crtc->gamma_blue[0])); } + xf86RandR12CrtcReloadGamma(randr_crtc); + return TRUE; } |