diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index c10504c32901c2157f280f8404141e75ef3aed57..d6df28f5a685e20172cde18d1cc984c78b9bae21 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -2404,10 +2404,23 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, MS_LOGLEVEL_DEBUG, "Allocated crtc nr. %d to this screen.\n", num); - drmmode_crtc->use_gamma_lut = - drmmode_crtc->props[DRMMODE_CRTC_GAMMA_LUT_SIZE].prop_id && - drmmode_crtc->props[DRMMODE_CRTC_GAMMA_LUT_SIZE].value && - xf86ReturnOptValBool(drmmode->Options, OPTION_USE_GAMMA_LUT, TRUE); + if (drmmode_crtc->props[DRMMODE_CRTC_GAMMA_LUT_SIZE].prop_id && + drmmode_crtc->props[DRMMODE_CRTC_GAMMA_LUT_SIZE].value) { + /* + * GAMMA_LUT property supported, and so far tested to be safe to use by + * default for lut sizes up to 4096 slots. Intel Tigerlake+ has some + * issues, and a large GAMMA_LUT with 262145 slots, so keep GAMMA_LUT + * off for large lut sizes by default for now. + */ + drmmode_crtc->use_gamma_lut = drmmode_crtc->props[DRMMODE_CRTC_GAMMA_LUT_SIZE].value <= 4096; + + /* Allow config override. */ + drmmode_crtc->use_gamma_lut = xf86ReturnOptValBool(drmmode->Options, + OPTION_USE_GAMMA_LUT, + drmmode_crtc->use_gamma_lut); + } else { + drmmode_crtc->use_gamma_lut = FALSE; + } if (drmmode_crtc->use_gamma_lut && drmmode_crtc->props[DRMMODE_CRTC_CTM].prop_id) { diff --git a/hw/xfree86/drivers/modesetting/modesetting.man b/hw/xfree86/drivers/modesetting/modesetting.man index 0145344d2ca1a2fccbd80ec496267510ac95b973..bb948380b1eb232d278806404566e95d98780564 100644 --- a/hw/xfree86/drivers/modesetting/modesetting.man +++ b/hw/xfree86/drivers/modesetting/modesetting.man @@ -99,8 +99,8 @@ will assign xrandr outputs LVDS and VGA-0 to this instance of the driver. .BI "Option \*qUseGammaLUT\*q \*q" boolean \*q Enable or disable use of the GAMMA_LUT property, when available. When enabled, this option allows the driver to use gamma ramps with more -entries, if supported by the kernel. -Default: on. +entries, if supported by the kernel. By default, GAMMA_LUT will be used for +kms drivers which are known to be safe for use of GAMMA_LUT. .TP .SH "SEE ALSO" @xservername@(@appmansuffix@), @xconfigfile@(@filemansuffix@), Xserver(@appmansuffix@),