All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/1] Color space conversion uapi part2
@ 2018-02-26 15:59 Alexandru Gheorghe
  2018-02-26 15:59 ` [PATCH 1/1] [RFC] drm: Add per-plane color management Alexandru Gheorghe
  2018-02-26 16:04 ` [RFC 0/1] Color space conversion uapi part2 Ville Syrjälä
  0 siblings, 2 replies; 5+ messages in thread
From: Alexandru Gheorghe @ 2018-02-26 15:59 UTC (permalink / raw)
  To: liviu.dudau, brian.starkey, airlied, dri-devel, mihail.atanassov,
	gustavo, maarten.lankhorst, seanpaul
  Cc: nd, Alexandru Gheorghe

This is an attempt to revive the color space conversation that started
here [1] and was materialized with the color encoding and color range
properties for converting YUV2RGB, the last version of this patch
series is here [2].

However, we still need a way of specifing the color gamut and transfer
function(gamma) for a given plane, in order to be sure that the
blending is done in the same domain space, which is not an issue for
similar gammuts, but not so good when mixing wider gamuts like Rec2020
and DCI-P3 with narrow ones.

In consequence, the userspace needs to control what is the color gamut
used for blending.

On Mali DP hardware, a complete color processing pipeline for a plane
looks like this:

YUV2RGB -> DEGAMA -> RGB2RGB(Gammut conv) -> GAMMA.

Of course, depending on hardware generation some of this elements are
not present or disabled if we are dealing with a RGB buffer already
in linear space. But it's up to the usperspace to decide what it wants
when the hardware doesn't provide full support for its needs.

What this patchset proposes is to add plane degamma, ctm and gamma
properties to be applied in this order after the yuv2rgb conversion
specified by the color encoding property[2]. We already have this sort
of pipeline(degamma, ctm, gamma) at the other end of a CRTC, so it
wouldn't be a totaly new interface for userspaces to figure it out how
to use.

There are still some things to be done before getting this patchset in
mergeable shape like: mali-dp driver implementation, real userspace
(drm_hwcomposer is the likely candidate here, but I'm open to
suggestions here), reuse some of the code for both crtc and plane.

But first, I would like to see what everybody things about this idea,
or if it has a different perspective of how this should be handled.

[1] https://lkml.org/lkml/2017/3/16/681
[2] https://www.spinics.net/lists/intel-gfx/msg156211.html

Mihail Atanassov (1):
  drm: Add per-plane color management

 drivers/gpu/drm/drm_atomic.c        | 28 ++++++++++++++
 drivers/gpu/drm/drm_atomic_helper.c |  9 +++++
 drivers/gpu/drm/drm_color_mgmt.c    | 76 +++++++++++++++++++++++++++----------
 include/drm/drm_color_mgmt.h        |  5 +++
 include/drm/drm_mode_config.h       | 20 +++++-----
 include/drm/drm_plane.h             |  8 ++++
 6 files changed, 117 insertions(+), 29 deletions(-)

-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] [RFC] drm: Add per-plane color management
  2018-02-26 15:59 [RFC 0/1] Color space conversion uapi part2 Alexandru Gheorghe
@ 2018-02-26 15:59 ` Alexandru Gheorghe
  2018-02-26 16:04 ` [RFC 0/1] Color space conversion uapi part2 Ville Syrjälä
  1 sibling, 0 replies; 5+ messages in thread
From: Alexandru Gheorghe @ 2018-02-26 15:59 UTC (permalink / raw)
  To: liviu.dudau, brian.starkey, airlied, dri-devel, mihail.atanassov,
	gustavo, maarten.lankhorst, seanpaul
  Cc: nd, Alexandru Gheorghe

From: Mihail Atanassov <mihail.atanassov@arm.com>

Export drm_plane_enable_color_mgmt, which attaches the existing degamma,
ctm, and gamma properties to a plane. Add a color_mgmt_changed flag to
drm_plane_state, mimicking the drm_crtc_state flag of the same name.

Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
---
 drivers/gpu/drm/drm_atomic.c        | 33 ++++++++++++++++
 drivers/gpu/drm/drm_atomic_helper.c |  9 +++++
 drivers/gpu/drm/drm_color_mgmt.c    | 76 +++++++++++++++++++++++++++----------
 include/drm/drm_color_mgmt.h        |  5 +++
 include/drm/drm_mode_config.h       | 20 +++++-----
 include/drm/drm_plane.h             |  8 ++++
 6 files changed, 122 insertions(+), 29 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 46733d5..39af45f 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -717,6 +717,8 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane,
 {
 	struct drm_device *dev = plane->dev;
 	struct drm_mode_config *config = &dev->mode_config;
+	bool replaced = false;
+	int ret;
 
 	if (property == config->prop_fb_id) {
 		struct drm_framebuffer *fb = drm_framebuffer_lookup(dev, NULL, val);
@@ -762,6 +764,31 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane,
 	} else if (plane->funcs->atomic_set_property) {
 		return plane->funcs->atomic_set_property(plane, state,
 				property, val);
+	}
+	if (property == config->degamma_lut_property) {
+		ret = drm_atomic_replace_property_blob_from_id(dev,
+					&state->degamma_lut,
+					val,
+					-1,
+					&replaced);
+		state->color_mgmt_changed |= replaced;
+		return ret;
+	} else if (property == config->ctm_property) {
+		ret = drm_atomic_replace_property_blob_from_id(dev,
+					&state->ctm,
+					val,
+					sizeof(struct drm_color_ctm),
+					&replaced);
+		state->color_mgmt_changed |= replaced;
+		return ret;
+	} else if (property == config->gamma_lut_property) {
+		ret = drm_atomic_replace_property_blob_from_id(dev,
+					&state->gamma_lut,
+					val,
+					-1,
+					&replaced);
+		state->color_mgmt_changed |= replaced;
+		return ret;
 	} else {
 		return -EINVAL;
 	}
@@ -814,6 +841,12 @@ drm_atomic_plane_get_property(struct drm_plane *plane,
 		*val = state->src_w;
 	} else if (property == config->prop_src_h) {
 		*val = state->src_h;
+	} else if (property == config->degamma_lut_property) {
+		*val = (state->degamma_lut) ? state->degamma_lut->base.id : 0;
+	} else if (property == config->ctm_property) {
+		*val = (state->ctm) ? state->ctm->base.id : 0;
+	} else if (property == config->gamma_lut_property) {
+		*val = (state->gamma_lut) ? state->gamma_lut->base.id : 0;
 	} else if (property == plane->rotation_property) {
 		*val = state->rotation;
 	} else if (property == plane->zpos_property) {
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index ae3cbfe..1995b49 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -3501,6 +3501,12 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,
 
 	if (state->fb)
 		drm_framebuffer_get(state->fb);
+	if (state->degamma_lut)
+		drm_property_reference_blob(state->degamma_lut);
+	if (state->ctm)
+		drm_property_reference_blob(state->ctm);
+	if (state->gamma_lut)
+		drm_property_reference_blob(state->gamma_lut);
 
 	state->fence = NULL;
 	state->commit = NULL;
@@ -3548,6 +3554,9 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)
 
 	if (state->commit)
 		drm_crtc_commit_put(state->commit);
+	drm_property_unreference_blob(state->degamma_lut);
+	drm_property_unreference_blob(state->ctm);
+	drm_property_unreference_blob(state->gamma_lut);
 }
 EXPORT_SYMBOL(__drm_atomic_helper_plane_destroy_state);
 
diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c
index 0d002b0..e0871ce 100644
--- a/drivers/gpu/drm/drm_color_mgmt.c
+++ b/drivers/gpu/drm/drm_color_mgmt.c
@@ -90,6 +90,61 @@
  * "GAMMA_LUT" property above.
  */
 
+static void drm_object_enable_color_mgmt(struct drm_mode_object *drm_object,
+					 struct drm_mode_config *config,
+					 uint degamma_lut_size,
+					 bool has_ctm,
+					 uint gamma_lut_size)
+{
+	if (degamma_lut_size) {
+		drm_object_attach_property(drm_object,
+					   config->degamma_lut_property, 0);
+		drm_object_attach_property(drm_object,
+					   config->degamma_lut_size_property,
+					   degamma_lut_size);
+	}
+
+	if (has_ctm)
+		drm_object_attach_property(drm_object,
+					   config->ctm_property, 0);
+
+	if (gamma_lut_size) {
+		drm_object_attach_property(drm_object,
+					   config->gamma_lut_property, 0);
+		drm_object_attach_property(drm_object,
+					   config->gamma_lut_size_property,
+					   gamma_lut_size);
+	}
+}
+
+/**
+ * drm_plane_enable_color_mgmt - enable color management properties for a plane
+ * @plane: DRM plane
+ * @degamma_lut_size: the size of the degamma lut (before CSC)
+ * @has_ctm: whether to attach ctm_property for CSC matrix
+ * @gamma_lut_size: the size of the gamma lut (after CSC)
+ *
+ * This function lets the driver enable the color correction
+ * properties on a plane. This includes 3 degamma, csc and gamma
+ * properties that userspace can set and 2 size properties to inform
+ * the userspace of the lut sizes. Each of the properties is
+ * optional. The gamma and degamma properties are only attached if
+ * their size is not 0 and ctm_property is only attached if has_ctm is
+ * true.
+ */
+void drm_plane_enable_color_mgmt(struct drm_plane *plane,
+				 uint degamma_lut_size,
+				 bool has_ctm,
+				 uint gamma_lut_size)
+{
+	struct drm_device *dev = plane->dev;
+	struct drm_mode_config *config = &dev->mode_config;
+
+	drm_object_enable_color_mgmt(&plane->base, config,
+				     degamma_lut_size, has_ctm, gamma_lut_size);
+}
+EXPORT_SYMBOL(drm_plane_enable_color_mgmt);
+
 /**
  * drm_color_lut_extract - clamp and round LUT entries
  * @user_input: input value
@@ -140,25 +195,8 @@ void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc,
 	struct drm_device *dev = crtc->dev;
 	struct drm_mode_config *config = &dev->mode_config;
 
-	if (degamma_lut_size) {
-		drm_object_attach_property(&crtc->base,
-					   config->degamma_lut_property, 0);
-		drm_object_attach_property(&crtc->base,
-					   config->degamma_lut_size_property,
-					   degamma_lut_size);
-	}
-
-	if (has_ctm)
-		drm_object_attach_property(&crtc->base,
-					   config->ctm_property, 0);
-
-	if (gamma_lut_size) {
-		drm_object_attach_property(&crtc->base,
-					   config->gamma_lut_property, 0);
-		drm_object_attach_property(&crtc->base,
-					   config->gamma_lut_size_property,
-					   gamma_lut_size);
-	}
+	drm_object_enable_color_mgmt(&crtc->base, config,
+				     degamma_lut_size, has_ctm, gamma_lut_size);
 }
 EXPORT_SYMBOL(drm_crtc_enable_color_mgmt);
 
diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h
index 03a59cb..831b09f 100644
--- a/include/drm/drm_color_mgmt.h
+++ b/include/drm/drm_color_mgmt.h
@@ -29,6 +29,11 @@ struct drm_crtc;
 
 uint32_t drm_color_lut_extract(uint32_t user_input, uint32_t bit_precision);
 
+void drm_plane_enable_color_mgmt(struct drm_plane *plane,
+				 uint degamma_lut_size,
+				 bool has_ctm,
+				 uint gamma_lut_size);
+
 void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc,
 				uint degamma_lut_size,
 				bool has_ctm,
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
index 7569f22..a19e59e 100644
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@ -727,30 +727,30 @@ struct drm_mode_config {
 	 */
 	struct drm_property *aspect_ratio_property;
 	/**
-	 * @degamma_lut_property: Optional CRTC property to set the LUT used to
-	 * convert the framebuffer's colors to linear gamma.
+	 * @degamma_lut_property: Optional CRTC or plane property to set the
+	 * LUT used to convert the framebuffer's colors to linear gamma.
 	 */
 	struct drm_property *degamma_lut_property;
 	/**
-	 * @degamma_lut_size_property: Optional CRTC property for the size of
-	 * the degamma LUT as supported by the driver (read-only).
+	 * @degamma_lut_size_property: Optional CRTC or plane property for the
+	 * size of the degamma LUT as supported by the driver (read-only).
 	 */
 	struct drm_property *degamma_lut_size_property;
 	/**
-	 * @ctm_property: Optional CRTC property to set the
+	 * @ctm_property: Optional CRTC or plane property to set the
 	 * matrix used to convert colors after the lookup in the
 	 * degamma LUT.
 	 */
 	struct drm_property *ctm_property;
 	/**
-	 * @gamma_lut_property: Optional CRTC property to set the LUT used to
-	 * convert the colors, after the CTM matrix, to the gamma space of the
-	 * connected screen.
+	 * @gamma_lut_property: Optional CRTC or plane property to set the LUT
+	 * used to convert the colors, after the CTM matrix, to the gamma space
+	 * of the connected screen.
 	 */
 	struct drm_property *gamma_lut_property;
 	/**
-	 * @gamma_lut_size_property: Optional CRTC property for the size of the
-	 * gamma LUT as supported by the driver (read-only).
+	 * @gamma_lut_size_property: Optional CRTC or plane property for the
+	 * size of the gamma LUT as supported by the driver (read-only).
 	 */
 	struct drm_property *gamma_lut_size_property;
 
diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
index 8185e34..dd52fab 100644
--- a/include/drm/drm_plane.h
+++ b/include/drm/drm_plane.h
@@ -105,6 +105,11 @@ struct drm_plane_state {
 	uint32_t src_x, src_y;
 	uint32_t src_h, src_w;
 
+	/* Color transform blob properties exposed to userspace */
+	struct drm_property_blob *degamma_lut;
+	struct drm_property_blob *ctm;
+	struct drm_property_blob *gamma_lut;
+
 	/* Plane rotation */
 	unsigned int rotation;
 
@@ -131,6 +136,9 @@ struct drm_plane_state {
 	 */
 	struct drm_crtc_commit *commit;
 
+	/* computed state bits used by drivers */
+	bool color_mgmt_changed : 1;
+
 	struct drm_atomic_state *state;
 };
 
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFC 0/1] Color space conversion uapi part2
  2018-02-26 15:59 [RFC 0/1] Color space conversion uapi part2 Alexandru Gheorghe
  2018-02-26 15:59 ` [PATCH 1/1] [RFC] drm: Add per-plane color management Alexandru Gheorghe
@ 2018-02-26 16:04 ` Ville Syrjälä
  2018-02-26 16:48   ` Alexandru-Cosmin Gheorghe
  1 sibling, 1 reply; 5+ messages in thread
From: Ville Syrjälä @ 2018-02-26 16:04 UTC (permalink / raw)
  To: Alexandru Gheorghe; +Cc: nd, airlied, liviu.dudau, dri-devel, mihail.atanassov

On Mon, Feb 26, 2018 at 03:59:21PM +0000, Alexandru Gheorghe wrote:
> This is an attempt to revive the color space conversation that started
> here [1] and was materialized with the color encoding and color range
> properties for converting YUV2RGB, the last version of this patch
> series is here [2].
> 
> However, we still need a way of specifing the color gamut and transfer
> function(gamma) for a given plane, in order to be sure that the
> blending is done in the same domain space, which is not an issue for
> similar gammuts, but not so good when mixing wider gamuts like Rec2020
> and DCI-P3 with narrow ones.
> 
> In consequence, the userspace needs to control what is the color gamut
> used for blending.
> 
> On Mali DP hardware, a complete color processing pipeline for a plane
> looks like this:
> 
> YUV2RGB -> DEGAMA -> RGB2RGB(Gammut conv) -> GAMMA.
> 
> Of course, depending on hardware generation some of this elements are
> not present or disabled if we are dealing with a RGB buffer already
> in linear space. But it's up to the usperspace to decide what it wants
> when the hardware doesn't provide full support for its needs.
> 
> What this patchset proposes is to add plane degamma, ctm and gamma
> properties to be applied in this order after the yuv2rgb conversion
> specified by the color encoding property[2]. We already have this sort
> of pipeline(degamma, ctm, gamma) at the other end of a CRTC, so it
> wouldn't be a totaly new interface for userspaces to figure it out how
> to use.
> 
> There are still some things to be done before getting this patchset in
> mergeable shape like: mali-dp driver implementation, real userspace
> (drm_hwcomposer is the likely candidate here, but I'm open to
> suggestions here), reuse some of the code for both crtc and plane.
> 
> But first, I would like to see what everybody things about this idea,
> or if it has a different perspective of how this should be handled.
> 
> [1] https://lkml.org/lkml/2017/3/16/681
> [2] https://www.spinics.net/lists/intel-gfx/msg156211.html

How is this related to eg.
https://patchwork.freedesktop.org/series/30876/ ?

> 
> Mihail Atanassov (1):
>   drm: Add per-plane color management
> 
>  drivers/gpu/drm/drm_atomic.c        | 28 ++++++++++++++
>  drivers/gpu/drm/drm_atomic_helper.c |  9 +++++
>  drivers/gpu/drm/drm_color_mgmt.c    | 76 +++++++++++++++++++++++++++----------
>  include/drm/drm_color_mgmt.h        |  5 +++
>  include/drm/drm_mode_config.h       | 20 +++++-----
>  include/drm/drm_plane.h             |  8 ++++
>  6 files changed, 117 insertions(+), 29 deletions(-)
> 
> -- 
> 2.7.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC 0/1] Color space conversion uapi part2
  2018-02-26 16:04 ` [RFC 0/1] Color space conversion uapi part2 Ville Syrjälä
@ 2018-02-26 16:48   ` Alexandru-Cosmin Gheorghe
  2018-02-27  8:25     ` Shankar, Uma
  0 siblings, 1 reply; 5+ messages in thread
From: Alexandru-Cosmin Gheorghe @ 2018-02-26 16:48 UTC (permalink / raw)
  To: Ville Syrjälä, Uma Shankar
  Cc: airlied, nd, liviu.dudau, dri-devel, mihail.atanassov

On Mon, Feb 26, 2018 at 06:04:37PM +0200, Ville Syrjälä wrote:
> On Mon, Feb 26, 2018 at 03:59:21PM +0000, Alexandru Gheorghe wrote:
> > This is an attempt to revive the color space conversation that started
> > here [1] and was materialized with the color encoding and color range
> > properties for converting YUV2RGB, the last version of this patch
> > series is here [2].
> > 
> > However, we still need a way of specifing the color gamut and transfer
> > function(gamma) for a given plane, in order to be sure that the
> > blending is done in the same domain space, which is not an issue for
> > similar gammuts, but not so good when mixing wider gamuts like Rec2020
> > and DCI-P3 with narrow ones.
> > 
> > In consequence, the userspace needs to control what is the color gamut
> > used for blending.
> > 
> > On Mali DP hardware, a complete color processing pipeline for a plane
> > looks like this:
> > 
> > YUV2RGB -> DEGAMA -> RGB2RGB(Gammut conv) -> GAMMA.
> > 
> > Of course, depending on hardware generation some of this elements are
> > not present or disabled if we are dealing with a RGB buffer already
> > in linear space. But it's up to the usperspace to decide what it wants
> > when the hardware doesn't provide full support for its needs.
> > 
> > What this patchset proposes is to add plane degamma, ctm and gamma
> > properties to be applied in this order after the yuv2rgb conversion
> > specified by the color encoding property[2]. We already have this sort
> > of pipeline(degamma, ctm, gamma) at the other end of a CRTC, so it
> > wouldn't be a totaly new interface for userspaces to figure it out how
> > to use.
> > 
> > There are still some things to be done before getting this patchset in
> > mergeable shape like: mali-dp driver implementation, real userspace
> > (drm_hwcomposer is the likely candidate here, but I'm open to
> > suggestions here), reuse some of the code for both crtc and plane.
> > 
> > But first, I would like to see what everybody things about this idea,
> > or if it has a different perspective of how this should be handled.
> > 
> > [1] https://lkml.org/lkml/2017/3/16/681
> > [2] https://www.spinics.net/lists/intel-gfx/msg156211.html
> 
> How is this related to eg.
> https://patchwork.freedesktop.org/series/30876/ ?
I wasn't aware of this patchset. Thanks.
Same idea, almost identical implementation, I suppose it's true that
some topics pop-up periodically.

@Uma, is there an updated patchset anywhere that I missed.

> 
> > 
> > Mihail Atanassov (1):
> >   drm: Add per-plane color management
> > 
> >  drivers/gpu/drm/drm_atomic.c        | 28 ++++++++++++++
> >  drivers/gpu/drm/drm_atomic_helper.c |  9 +++++
> >  drivers/gpu/drm/drm_color_mgmt.c    | 76 +++++++++++++++++++++++++++----------
> >  include/drm/drm_color_mgmt.h        |  5 +++
> >  include/drm/drm_mode_config.h       | 20 +++++-----
> >  include/drm/drm_plane.h             |  8 ++++
> >  6 files changed, 117 insertions(+), 29 deletions(-)
> > 
> > -- 
> > 2.7.4
> > 
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
> -- 
> Ville Syrjälä
> Intel OTC
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [RFC 0/1] Color space conversion uapi part2
  2018-02-26 16:48   ` Alexandru-Cosmin Gheorghe
@ 2018-02-27  8:25     ` Shankar, Uma
  0 siblings, 0 replies; 5+ messages in thread
From: Shankar, Uma @ 2018-02-27  8:25 UTC (permalink / raw)
  To: Alexandru-Cosmin Gheorghe, Ville Syrjälä
  Cc: airlied, nd, liviu.dudau, dri-devel, mihail.atanassov



>-----Original Message-----
>From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of
>Alexandru-Cosmin Gheorghe
>Sent: Monday, February 26, 2018 10:18 PM
>To: Ville Syrjälä <ville.syrjala@linux.intel.com>; Shankar, Uma
><uma.shankar@intel.com>
>Cc: airlied@linux.ie; nd@arm.com; liviu.dudau@arm.com; dri-
>devel@lists.freedesktop.org; mihail.atanassov@arm.com
>Subject: Re: [RFC 0/1] Color space conversion uapi part2
>
>On Mon, Feb 26, 2018 at 06:04:37PM +0200, Ville Syrjälä wrote:
>> On Mon, Feb 26, 2018 at 03:59:21PM +0000, Alexandru Gheorghe wrote:
>> > This is an attempt to revive the color space conversation that
>> > started here [1] and was materialized with the color encoding and
>> > color range properties for converting YUV2RGB, the last version of
>> > this patch series is here [2].
>> >
>> > However, we still need a way of specifing the color gamut and
>> > transfer
>> > function(gamma) for a given plane, in order to be sure that the
>> > blending is done in the same domain space, which is not an issue for
>> > similar gammuts, but not so good when mixing wider gamuts like
>> > Rec2020 and DCI-P3 with narrow ones.
>> >
>> > In consequence, the userspace needs to control what is the color
>> > gamut used for blending.
>> >
>> > On Mali DP hardware, a complete color processing pipeline for a
>> > plane looks like this:
>> >
>> > YUV2RGB -> DEGAMA -> RGB2RGB(Gammut conv) -> GAMMA.
>> >
>> > Of course, depending on hardware generation some of this elements
>> > are not present or disabled if we are dealing with a RGB buffer
>> > already in linear space. But it's up to the usperspace to decide
>> > what it wants when the hardware doesn't provide full support for its needs.
>> >
>> > What this patchset proposes is to add plane degamma, ctm and gamma
>> > properties to be applied in this order after the yuv2rgb conversion
>> > specified by the color encoding property[2]. We already have this
>> > sort of pipeline(degamma, ctm, gamma) at the other end of a CRTC, so
>> > it wouldn't be a totaly new interface for userspaces to figure it
>> > out how to use.
>> >
>> > There are still some things to be done before getting this patchset
>> > in mergeable shape like: mali-dp driver implementation, real
>> > userspace (drm_hwcomposer is the likely candidate here, but I'm open
>> > to suggestions here), reuse some of the code for both crtc and plane.
>> >
>> > But first, I would like to see what everybody things about this
>> > idea, or if it has a different perspective of how this should be handled.
>> >
>> > [1] https://lkml.org/lkml/2017/3/16/681
>> > [2] https://www.spinics.net/lists/intel-gfx/msg156211.html
>>
>> How is this related to eg.
>> https://patchwork.freedesktop.org/series/30876/ ?
>I wasn't aware of this patchset. Thanks.
>Same idea, almost identical implementation, I suppose it's true that some topics
>pop-up periodically.
>
>@Uma, is there an updated patchset anywhere that I missed.
>

Hi Alexandru,
The series which Ville highlighted (https://patchwork.freedesktop.org/series/30876/)
was published long back, but due to lack of userspace consumers (hwc, Weston etc.), 
cannot be considered for merge. We are trying to get that implemented at Intel (still
little far away though)

In principal, people were ok with this idea of having color correction support at plane
level for efficient blending.

Regards,
Uma Shankar
>>
>> >
>> > Mihail Atanassov (1):
>> >   drm: Add per-plane color management
>> >
>> >  drivers/gpu/drm/drm_atomic.c        | 28 ++++++++++++++
>> >  drivers/gpu/drm/drm_atomic_helper.c |  9 +++++
>> >  drivers/gpu/drm/drm_color_mgmt.c    | 76 +++++++++++++++++++++++++++-
>---------
>> >  include/drm/drm_color_mgmt.h        |  5 +++
>> >  include/drm/drm_mode_config.h       | 20 +++++-----
>> >  include/drm/drm_plane.h             |  8 ++++
>> >  6 files changed, 117 insertions(+), 29 deletions(-)
>> >
>> > --
>> > 2.7.4
>> >
>> > _______________________________________________
>> > dri-devel mailing list
>> > dri-devel@lists.freedesktop.org
>> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>> --
>> Ville Syrjälä
>> Intel OTC
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>_______________________________________________
>dri-devel mailing list
>dri-devel@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-02-27  8:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-26 15:59 [RFC 0/1] Color space conversion uapi part2 Alexandru Gheorghe
2018-02-26 15:59 ` [PATCH 1/1] [RFC] drm: Add per-plane color management Alexandru Gheorghe
2018-02-26 16:04 ` [RFC 0/1] Color space conversion uapi part2 Ville Syrjälä
2018-02-26 16:48   ` Alexandru-Cosmin Gheorghe
2018-02-27  8:25     ` Shankar, Uma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.