[PATCH xserver] xfree86/modes: Handle no palette case better in xf86RandR12CrtcSetGamma
Alex Deucher
alexdeucher at gmail.com
Mon Aug 1 14:10:52 UTC 2016
On Mon, Aug 1, 2016 at 3:46 AM, Michel Dänzer <michel at daenzer.net> wrote:
> On 29.07.2016 17:51, Michel Dänzer wrote:
>> From: Michel Dänzer <michel.daenzer at amd.com>
>>
>> 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 at amd.com>
>
>> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
>> ---
>> hw/xfree86/modes/xf86RandR12.c | 10 +++++++++-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
>> index 4e0e4a8..c28a4e0 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;
>> }
>>
>>
>
>
> --
> Earthling Michel Dänzer | http://www.amd.com
> Libre software enthusiast | Mesa and X developer
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
More information about the xorg-devel
mailing list