Skip to content
  • Hans de Goede's avatar
    xf86RandR12: Fix XF86VidModeSetGamma triggering a BadImplementation error · 02ff0a5d
    Hans de Goede authored and Adam Jackson's avatar Adam Jackson committed
    Commit b4e46c04 ("xfree86: Hook up colormaps and RandR 1.2 gamma code")
    dropped the providing of a pScrn->ChangeGamma callback from the xf86RandR12
    code. Leaving pScrn->ChangeGamma NULL in most cases.
    
    This triggers the BadImplementation error in xf86ChangeGamma() :
    
        if (pScrn->ChangeGamma)
            return (*pScrn->ChangeGamma) (pScrn, gamma);
    
        return BadImplementation;
    
    Which causes X-apps using XF86VidModeSetGamma to crash with a
    X protocol error.
    
    This commit fixes this by re-introducing the xf86RandR12ChangeGamma
    helper removed by the commit and adjusting it to work with the new
    combined palette / gamma code.
    
    Fixes: b4e46c04
    
     ("xfree86: Hook up colormaps and RandR 1.2 gamma code")
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    02ff0a5d