[PATCH 5/6] drm/exynos: plane: Add range property to exynos plane

From: Christoph Manszewski
Date: Fri Dec 14 2018 - 07:28:52 EST


Create range property within exynos_drm_plane_init and set to default value
in exynos_drm_plane_reset.

Signed-off-by: Christoph Manszewski <c.manszewski@xxxxxxxxxxx>
---
drivers/gpu/drm/exynos/exynos_drm_plane.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index cf352d980eee..a6ab0e7277f0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -140,6 +140,7 @@ static void exynos_drm_plane_reset(struct drm_plane *plane)
if (exynos_state) {
__drm_atomic_helper_plane_reset(plane, &exynos_state->base);
plane->state->zpos = exynos_plane->config->zpos;
+ plane->state->color_range = exynos_plane->config->range;
}
}

@@ -301,6 +302,10 @@ int exynos_plane_init(struct drm_device *dev,
unsigned int supported_modes = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
BIT(DRM_MODE_BLEND_PREMULTI) |
BIT(DRM_MODE_BLEND_COVERAGE);
+
+ u32 supported_ranges = BIT(DRM_COLOR_LIMITED_RANGE) |
+ BIT(DRM_COLOR_FULL_RANGE);
+
struct drm_plane *plane = &exynos_plane->base;

err = drm_universal_plane_init(dev, plane,
@@ -328,5 +333,9 @@ int exynos_plane_init(struct drm_device *dev,
if (config->capabilities & EXYNOS_DRM_PLANE_CAP_WIN_BLEND)
drm_plane_create_alpha_property(plane);

+ if (config->capabilities & EXYNOS_DRM_PLANE_CAP_RANGE)
+ drm_plane_create_range_property(plane, supported_ranges,
+ config->range);
+
return 0;
}
--
2.7.4