aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r--drivers/gpu/drm/drm_crtc.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index a4e259524e11..df91dfe506eb 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -6023,3 +6023,48 @@ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
6023 return tg; 6023 return tg;
6024} 6024}
6025EXPORT_SYMBOL(drm_mode_create_tile_group); 6025EXPORT_SYMBOL(drm_mode_create_tile_group);
6026
6027/**
6028 * drm_crtc_enable_color_mgmt - enable color management properties
6029 * @crtc: DRM CRTC
6030 * @degamma_lut_size: the size of the degamma lut (before CSC)
6031 * @has_ctm: whether to attach ctm_property for CSC matrix
6032 * @gamma_lut_size: the size of the gamma lut (after CSC)
6033 *
6034 * This function lets the driver enable the color correction
6035 * properties on a CRTC. This includes 3 degamma, csc and gamma
6036 * properties that userspace can set and 2 size properties to inform
6037 * the userspace of the lut sizes. Each of the properties are
6038 * optional. The gamma and degamma properties are only attached if
6039 * their size is not 0 and ctm_property is only attached if has_ctm is
6040 * true.
6041 */
6042void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc,
6043 uint degamma_lut_size,
6044 bool has_ctm,
6045 uint gamma_lut_size)
6046{
6047 struct drm_device *dev = crtc->dev;
6048 struct drm_mode_config *config = &dev->mode_config;
6049
6050 if (degamma_lut_size) {
6051 drm_object_attach_property(&crtc->base,
6052 config->degamma_lut_property, 0);
6053 drm_object_attach_property(&crtc->base,
6054 config->degamma_lut_size_property,
6055 degamma_lut_size);
6056 }
6057
6058 if (has_ctm)
6059 drm_object_attach_property(&crtc->base,
6060 config->ctm_property, 0);
6061
6062 if (gamma_lut_size) {
6063 drm_object_attach_property(&crtc->base,
6064 config->gamma_lut_property, 0);
6065 drm_object_attach_property(&crtc->base,
6066 config->gamma_lut_size_property,
6067 gamma_lut_size);
6068 }
6069}
6070EXPORT_SYMBOL(drm_crtc_enable_color_mgmt);