linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/3] drm/tegra: plane: Fix RGB565 plane format on older Tegra's
@ 2018-03-15  1:00 Dmitry Osipenko
  2018-03-15  1:00 ` [PATCH v1 2/3] drm/tegra: plane: Correct legacy blending Dmitry Osipenko
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Dmitry Osipenko @ 2018-03-15  1:00 UTC (permalink / raw)
  To: Thierry Reding; +Cc: dri-devel, linux-tegra, linux-kernel

Simplify opaque format adjustment by removing format checking. There are
only 4 formats that require the adjustment and so this way is less error
prone, avoiding mishandling native formats, like in this case RGB565 is
the format that was erroneously treated as invalid.

Fixes: ebae8d07435a ("drm/tegra: dc: Implement legacy blending")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/gpu/drm/tegra/dc.c    | 11 ++---------
 drivers/gpu/drm/tegra/plane.c | 21 ++++++---------------
 drivers/gpu/drm/tegra/plane.h |  2 +-
 3 files changed, 9 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 49df2db2ad46..22bf513612d1 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -456,15 +456,8 @@ static int tegra_plane_atomic_check(struct drm_plane *plane,
 	 * be emulated by disabling alpha blending for the plane.
 	 */
 	if (!dc->soc->supports_blending) {
-		if (!tegra_plane_format_has_alpha(format)) {
-			err = tegra_plane_format_get_alpha(format, &format);
-			if (err < 0)
-				return err;
-
-			plane_state->opaque = true;
-		} else {
-			plane_state->opaque = false;
-		}
+		plane_state->opaque = !tegra_plane_format_has_alpha(format);
+		format = tegra_plane_format_adjust(format);
 
 		tegra_plane_check_dependent(tegra, plane_state);
 	}
diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
index a056fbf83b53..fc37dcf8c458 100644
--- a/drivers/gpu/drm/tegra/plane.c
+++ b/drivers/gpu/drm/tegra/plane.c
@@ -268,32 +268,23 @@ bool tegra_plane_format_has_alpha(unsigned int format)
 	return false;
 }
 
-int tegra_plane_format_get_alpha(unsigned int opaque, unsigned int *alpha)
+unsigned int tegra_plane_format_adjust(unsigned int opaque)
 {
-	if (tegra_plane_format_is_yuv(opaque, NULL)) {
-		*alpha = opaque;
-		return 0;
-	}
-
 	switch (opaque) {
 	case WIN_COLOR_DEPTH_B5G5R5X1:
-		*alpha = WIN_COLOR_DEPTH_B5G5R5A1;
-		return 0;
+		return WIN_COLOR_DEPTH_B5G5R5A1;
 
 	case WIN_COLOR_DEPTH_X1B5G5R5:
-		*alpha = WIN_COLOR_DEPTH_A1B5G5R5;
-		return 0;
+		return WIN_COLOR_DEPTH_A1B5G5R5;
 
 	case WIN_COLOR_DEPTH_R8G8B8X8:
-		*alpha = WIN_COLOR_DEPTH_R8G8B8A8;
-		return 0;
+		return WIN_COLOR_DEPTH_R8G8B8A8;
 
 	case WIN_COLOR_DEPTH_B8G8R8X8:
-		*alpha = WIN_COLOR_DEPTH_B8G8R8A8;
-		return 0;
+		return WIN_COLOR_DEPTH_B8G8R8A8;
 	}
 
-	return -EINVAL;
+	return opaque;
 }
 
 unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane,
diff --git a/drivers/gpu/drm/tegra/plane.h b/drivers/gpu/drm/tegra/plane.h
index 6938719e7e5d..9fda841564cd 100644
--- a/drivers/gpu/drm/tegra/plane.h
+++ b/drivers/gpu/drm/tegra/plane.h
@@ -63,7 +63,7 @@ int tegra_plane_state_add(struct tegra_plane *plane,
 int tegra_plane_format(u32 fourcc, u32 *format, u32 *swap);
 bool tegra_plane_format_is_yuv(unsigned int format, bool *planar);
 bool tegra_plane_format_has_alpha(unsigned int format);
-int tegra_plane_format_get_alpha(unsigned int opaque, unsigned int *alpha);
+unsigned int tegra_plane_format_adjust(unsigned int opaque);
 void tegra_plane_check_dependent(struct tegra_plane *tegra,
 				 struct tegra_plane_state *state);
 
-- 
2.16.1

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

* [PATCH v1 2/3] drm/tegra: plane: Correct legacy blending
  2018-03-15  1:00 [PATCH v1 1/3] drm/tegra: plane: Fix RGB565 plane format on older Tegra's Dmitry Osipenko
@ 2018-03-15  1:00 ` Dmitry Osipenko
  2018-03-15 10:29   ` Thierry Reding
  2018-03-15  1:00 ` [PATCH v1 3/3] drm/tegra: dc: Dedicate overlay plane to cursor on older Tegra's Dmitry Osipenko
  2018-03-15 10:27 ` [PATCH v1 1/3] drm/tegra: plane: Fix RGB565 plane format " Thierry Reding
  2 siblings, 1 reply; 13+ messages in thread
From: Dmitry Osipenko @ 2018-03-15  1:00 UTC (permalink / raw)
  To: Thierry Reding; +Cc: dri-devel, linux-tegra, linux-kernel

Keep old 'dependent' state of unaffected planes, this way new state takes
into account current state of unaffected planes.

Fixes: ebae8d07435a ("drm/tegra: dc: Implement legacy blending")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/gpu/drm/tegra/plane.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
index fc37dcf8c458..3c0cb6a04c66 100644
--- a/drivers/gpu/drm/tegra/plane.c
+++ b/drivers/gpu/drm/tegra/plane.c
@@ -287,13 +287,11 @@ unsigned int tegra_plane_format_adjust(unsigned int opaque)
 	return opaque;
 }
 
-unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane,
-					   struct tegra_plane *other)
+static unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane,
+						  struct tegra_plane *other)
 {
 	unsigned int index = 0, i;
 
-	WARN_ON(plane == other);
-
 	for (i = 0; i < 3; i++) {
 		if (i == plane->index)
 			continue;
@@ -310,18 +308,15 @@ unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane,
 void tegra_plane_check_dependent(struct tegra_plane *tegra,
 				 struct tegra_plane_state *state)
 {
-	struct drm_plane_state *old, *new;
+	struct drm_plane_state *new;
 	struct drm_plane *plane;
 	unsigned int zpos[2];
 	unsigned int i;
 
-	for (i = 0; i < 3; i++)
-		state->dependent[i] = false;
-
 	for (i = 0; i < 2; i++)
 		zpos[i] = 0;
 
-	for_each_oldnew_plane_in_state(state->base.state, plane, old, new, i) {
+	for_each_new_plane_in_state(state->base.state, plane, new, i) {
 		struct tegra_plane *p = to_tegra_plane(plane);
 		unsigned index;
 
@@ -331,6 +326,8 @@ void tegra_plane_check_dependent(struct tegra_plane *tegra,
 
 		index = tegra_plane_get_overlap_index(tegra, p);
 
+		state->dependent[i] = false;
+
 		/*
 		 * If any of the other planes is on top of this plane and uses
 		 * a format with an alpha component, mark this plane as being
-- 
2.16.1

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

* [PATCH v1 3/3] drm/tegra: dc: Dedicate overlay plane to cursor on older Tegra's
  2018-03-15  1:00 [PATCH v1 1/3] drm/tegra: plane: Fix RGB565 plane format on older Tegra's Dmitry Osipenko
  2018-03-15  1:00 ` [PATCH v1 2/3] drm/tegra: plane: Correct legacy blending Dmitry Osipenko
@ 2018-03-15  1:00 ` Dmitry Osipenko
  2018-03-15 10:45   ` Thierry Reding
  2018-03-15 10:27 ` [PATCH v1 1/3] drm/tegra: plane: Fix RGB565 plane format " Thierry Reding
  2 siblings, 1 reply; 13+ messages in thread
From: Dmitry Osipenko @ 2018-03-15  1:00 UTC (permalink / raw)
  To: Thierry Reding; +Cc: dri-devel, linux-tegra, linux-kernel

Older Tegra's do not support RGBA format for the cursor, but instead
overlay plane could be used for it. Since there is no much use for the
overlays on a regular desktop and HW-accelerated cursor is much better
than a SW cursor, let's dedicate one overlay plane to the mouse cursor.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/gpu/drm/tegra/dc.c | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 22bf513612d1..e4d567ec07cc 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -857,9 +857,11 @@ static const u32 tegra124_overlay_formats[] = {
 
 static struct drm_plane *tegra_dc_overlay_plane_create(struct drm_device *drm,
 						       struct tegra_dc *dc,
-						       unsigned int index)
+						       unsigned int index,
+						       bool cursor)
 {
 	unsigned long possible_crtcs = tegra_plane_get_possible_crtcs(drm);
+	enum drm_plane_type type = DRM_PLANE_TYPE_OVERLAY;
 	struct tegra_plane *plane;
 	unsigned int num_formats;
 	const u32 *formats;
@@ -876,10 +878,12 @@ static struct drm_plane *tegra_dc_overlay_plane_create(struct drm_device *drm,
 	num_formats = dc->soc->num_overlay_formats;
 	formats = dc->soc->overlay_formats;
 
+	if (cursor)
+		type = DRM_PLANE_TYPE_CURSOR;
+
 	err = drm_universal_plane_init(drm, &plane->base, possible_crtcs,
 				       &tegra_plane_funcs, formats,
-				       num_formats, NULL,
-				       DRM_PLANE_TYPE_OVERLAY, NULL);
+				       num_formats, NULL, type, NULL);
 	if (err < 0) {
 		kfree(plane);
 		return ERR_PTR(err);
@@ -931,6 +935,7 @@ static struct drm_plane *tegra_dc_add_planes(struct drm_device *drm,
 					     struct tegra_dc *dc)
 {
 	struct drm_plane *planes[2], *primary;
+	unsigned int planes_num;
 	unsigned int i;
 	int err;
 
@@ -938,8 +943,14 @@ static struct drm_plane *tegra_dc_add_planes(struct drm_device *drm,
 	if (IS_ERR(primary))
 		return primary;
 
-	for (i = 0; i < 2; i++) {
-		planes[i] = tegra_dc_overlay_plane_create(drm, dc, 1 + i);
+	if (dc->soc->supports_cursor)
+		planes_num = 2;
+	else
+		planes_num = 1;
+
+	for (i = 0; i < planes_num; i++) {
+		planes[i] = tegra_dc_overlay_plane_create(drm, dc, 1 + i,
+							  false);
 		if (IS_ERR(planes[i])) {
 			err = PTR_ERR(planes[i]);
 
@@ -1857,6 +1868,13 @@ static int tegra_dc_init(struct host1x_client *client)
 			err = PTR_ERR(cursor);
 			goto cleanup;
 		}
+	} else {
+		/* dedicate one overlay to mouse cursor */
+		cursor = tegra_dc_overlay_plane_create(drm, dc, 2, true);
+		if (IS_ERR(cursor)) {
+			err = PTR_ERR(cursor);
+			goto cleanup;
+		}
 	}
 
 	err = drm_crtc_init_with_planes(drm, &dc->base, primary, cursor,
-- 
2.16.1

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

* Re: [PATCH v1 1/3] drm/tegra: plane: Fix RGB565 plane format on older Tegra's
  2018-03-15  1:00 [PATCH v1 1/3] drm/tegra: plane: Fix RGB565 plane format on older Tegra's Dmitry Osipenko
  2018-03-15  1:00 ` [PATCH v1 2/3] drm/tegra: plane: Correct legacy blending Dmitry Osipenko
  2018-03-15  1:00 ` [PATCH v1 3/3] drm/tegra: dc: Dedicate overlay plane to cursor on older Tegra's Dmitry Osipenko
@ 2018-03-15 10:27 ` Thierry Reding
  2018-03-15 12:48   ` Dmitry Osipenko
  2 siblings, 1 reply; 13+ messages in thread
From: Thierry Reding @ 2018-03-15 10:27 UTC (permalink / raw)
  To: Dmitry Osipenko; +Cc: dri-devel, linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 853 bytes --]

On Thu, Mar 15, 2018 at 04:00:23AM +0300, Dmitry Osipenko wrote:
> Simplify opaque format adjustment by removing format checking. There are
> only 4 formats that require the adjustment and so this way is less error
> prone, avoiding mishandling native formats, like in this case RGB565 is
> the format that was erroneously treated as invalid.
> 
> Fixes: ebae8d07435a ("drm/tegra: dc: Implement legacy blending")
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
>  drivers/gpu/drm/tegra/dc.c    | 11 ++---------
>  drivers/gpu/drm/tegra/plane.c | 21 ++++++---------------
>  drivers/gpu/drm/tegra/plane.h |  2 +-
>  3 files changed, 9 insertions(+), 25 deletions(-)

I've applied a slightly different version of this which doesn't rework
as much of the surrounding code and is therefore easier to backport to
v4.16.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v1 2/3] drm/tegra: plane: Correct legacy blending
  2018-03-15  1:00 ` [PATCH v1 2/3] drm/tegra: plane: Correct legacy blending Dmitry Osipenko
@ 2018-03-15 10:29   ` Thierry Reding
  2018-03-15 12:42     ` Dmitry Osipenko
  0 siblings, 1 reply; 13+ messages in thread
From: Thierry Reding @ 2018-03-15 10:29 UTC (permalink / raw)
  To: Dmitry Osipenko; +Cc: dri-devel, linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]

On Thu, Mar 15, 2018 at 04:00:24AM +0300, Dmitry Osipenko wrote:
> Keep old 'dependent' state of unaffected planes, this way new state takes
> into account current state of unaffected planes.
> 
> Fixes: ebae8d07435a ("drm/tegra: dc: Implement legacy blending")
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
>  drivers/gpu/drm/tegra/plane.c | 15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
> index fc37dcf8c458..3c0cb6a04c66 100644
> --- a/drivers/gpu/drm/tegra/plane.c
> +++ b/drivers/gpu/drm/tegra/plane.c
> @@ -287,13 +287,11 @@ unsigned int tegra_plane_format_adjust(unsigned int opaque)
>  	return opaque;
>  }
>  
> -unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane,
> -					   struct tegra_plane *other)
> +static unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane,
> +						  struct tegra_plane *other)

I'd prefer this to be a separate patch to keep the diff down to make
this easier to apply to v4.16. I can do that when I apply, no need to
resend.

>  {
>  	unsigned int index = 0, i;
>  
> -	WARN_ON(plane == other);
> -

Why would this need to go away? We still shouldn't be called with plane
== other because that makes no sense.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v1 3/3] drm/tegra: dc: Dedicate overlay plane to cursor on older Tegra's
  2018-03-15  1:00 ` [PATCH v1 3/3] drm/tegra: dc: Dedicate overlay plane to cursor on older Tegra's Dmitry Osipenko
@ 2018-03-15 10:45   ` Thierry Reding
  2018-03-16  7:36     ` Daniel Vetter
  0 siblings, 1 reply; 13+ messages in thread
From: Thierry Reding @ 2018-03-15 10:45 UTC (permalink / raw)
  To: Dmitry Osipenko; +Cc: dri-devel, linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 873 bytes --]

On Thu, Mar 15, 2018 at 04:00:25AM +0300, Dmitry Osipenko wrote:
> Older Tegra's do not support RGBA format for the cursor, but instead
> overlay plane could be used for it. Since there is no much use for the
> overlays on a regular desktop and HW-accelerated cursor is much better
> than a SW cursor, let's dedicate one overlay plane to the mouse cursor.
> 
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
>  drivers/gpu/drm/tegra/dc.c | 28 +++++++++++++++++++++++-----
>  1 file changed, 23 insertions(+), 5 deletions(-)

Applied. I'm not entirely happy that we need to sacrifice one of the
overlay windows for this, but you're right, it's probably okay given
how little planes are used on a regular desktop.

We could always provide a module parameter to switch this on and off
if that's ever something we want.

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v1 2/3] drm/tegra: plane: Correct legacy blending
  2018-03-15 10:29   ` Thierry Reding
@ 2018-03-15 12:42     ` Dmitry Osipenko
  2018-03-15 13:47       ` Dmitry Osipenko
  2018-03-15 13:47       ` Dmitry Osipenko
  0 siblings, 2 replies; 13+ messages in thread
From: Dmitry Osipenko @ 2018-03-15 12:42 UTC (permalink / raw)
  To: Thierry Reding; +Cc: dri-devel, linux-tegra, linux-kernel

On 15.03.2018 13:29, Thierry Reding wrote:
> On Thu, Mar 15, 2018 at 04:00:24AM +0300, Dmitry Osipenko wrote:
>> Keep old 'dependent' state of unaffected planes, this way new state takes
>> into account current state of unaffected planes.
>>
>> Fixes: ebae8d07435a ("drm/tegra: dc: Implement legacy blending")
>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>> ---
>>  drivers/gpu/drm/tegra/plane.c | 15 ++++++---------
>>  1 file changed, 6 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
>> index fc37dcf8c458..3c0cb6a04c66 100644
>> --- a/drivers/gpu/drm/tegra/plane.c
>> +++ b/drivers/gpu/drm/tegra/plane.c
>> @@ -287,13 +287,11 @@ unsigned int tegra_plane_format_adjust(unsigned int opaque)
>>  	return opaque;
>>  }
>>  
>> -unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane,
>> -					   struct tegra_plane *other)
>> +static unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane,
>> +						  struct tegra_plane *other)
> 
> I'd prefer this to be a separate patch to keep the diff down to make
> this easier to apply to v4.16. I can do that when I apply, no need to
> resend.

Okay. But now I'm thinking that it's probably not really worth to backport this
patch at all because it doesn't fix blending entirely, but only makes it good
enough to show cursor plane properly. I'll send V2.

>>  {
>>  	unsigned int index = 0, i;
>>  
>> -	WARN_ON(plane == other);
>> -
> 
> Why would this need to go away? We still shouldn't be called with plane
> == other because that makes no sense.
This can't ever happen because we are skipping 'plane' in for_each_plane_in_state().

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

* Re: [PATCH v1 1/3] drm/tegra: plane: Fix RGB565 plane format on older Tegra's
  2018-03-15 10:27 ` [PATCH v1 1/3] drm/tegra: plane: Fix RGB565 plane format " Thierry Reding
@ 2018-03-15 12:48   ` Dmitry Osipenko
  2018-03-15 12:58     ` Dmitry Osipenko
  0 siblings, 1 reply; 13+ messages in thread
From: Dmitry Osipenko @ 2018-03-15 12:48 UTC (permalink / raw)
  To: Thierry Reding; +Cc: dri-devel, linux-tegra, linux-kernel

On 15.03.2018 13:27, Thierry Reding wrote:
> On Thu, Mar 15, 2018 at 04:00:23AM +0300, Dmitry Osipenko wrote:
>> Simplify opaque format adjustment by removing format checking. There are
>> only 4 formats that require the adjustment and so this way is less error
>> prone, avoiding mishandling native formats, like in this case RGB565 is
>> the format that was erroneously treated as invalid.
>>
>> Fixes: ebae8d07435a ("drm/tegra: dc: Implement legacy blending")
>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>> ---
>>  drivers/gpu/drm/tegra/dc.c    | 11 ++---------
>>  drivers/gpu/drm/tegra/plane.c | 21 ++++++---------------
>>  drivers/gpu/drm/tegra/plane.h |  2 +-
>>  3 files changed, 9 insertions(+), 25 deletions(-)
> 
> I've applied a slightly different version of this which doesn't rework
> as much of the surrounding code and is therefore easier to backport to
> v4.16.

Okay. Please don't forget to push the modified patch, I don't see it in the FDO git.

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

* Re: [PATCH v1 1/3] drm/tegra: plane: Fix RGB565 plane format on older Tegra's
  2018-03-15 12:48   ` Dmitry Osipenko
@ 2018-03-15 12:58     ` Dmitry Osipenko
  0 siblings, 0 replies; 13+ messages in thread
From: Dmitry Osipenko @ 2018-03-15 12:58 UTC (permalink / raw)
  To: Thierry Reding; +Cc: dri-devel, linux-tegra, linux-kernel

On 15.03.2018 15:48, Dmitry Osipenko wrote:
> On 15.03.2018 13:27, Thierry Reding wrote:
>> On Thu, Mar 15, 2018 at 04:00:23AM +0300, Dmitry Osipenko wrote:
>>> Simplify opaque format adjustment by removing format checking. There are
>>> only 4 formats that require the adjustment and so this way is less error
>>> prone, avoiding mishandling native formats, like in this case RGB565 is
>>> the format that was erroneously treated as invalid.
>>>
>>> Fixes: ebae8d07435a ("drm/tegra: dc: Implement legacy blending")
>>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>>> ---
>>>  drivers/gpu/drm/tegra/dc.c    | 11 ++---------
>>>  drivers/gpu/drm/tegra/plane.c | 21 ++++++---------------
>>>  drivers/gpu/drm/tegra/plane.h |  2 +-
>>>  3 files changed, 9 insertions(+), 25 deletions(-)
>>
>> I've applied a slightly different version of this which doesn't rework
>> as much of the surrounding code and is therefore easier to backport to
>> v4.16.
> 
> Okay. Please don't forget to push the modified patch, I don't see it in the FDO git.

See it now.

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

* Re: [PATCH v1 2/3] drm/tegra: plane: Correct legacy blending
  2018-03-15 12:42     ` Dmitry Osipenko
@ 2018-03-15 13:47       ` Dmitry Osipenko
  2018-03-15 13:47       ` Dmitry Osipenko
  1 sibling, 0 replies; 13+ messages in thread
From: Dmitry Osipenko @ 2018-03-15 13:47 UTC (permalink / raw)
  To: Thierry Reding; +Cc: dri-devel, linux-tegra, linux-kernel

On 15.03.2018 15:42, Dmitry Osipenko wrote:
> On 15.03.2018 13:29, Thierry Reding wrote:
>> On Thu, Mar 15, 2018 at 04:00:24AM +0300, Dmitry Osipenko wrote:
>>> Keep old 'dependent' state of unaffected planes, this way new state takes
>>> into account current state of unaffected planes.
>>>
>>> Fixes: ebae8d07435a ("drm/tegra: dc: Implement legacy blending")
>>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>>> ---
>>>  drivers/gpu/drm/tegra/plane.c | 15 ++++++---------
>>>  1 file changed, 6 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
>>> index fc37dcf8c458..3c0cb6a04c66 100644
>>> --- a/drivers/gpu/drm/tegra/plane.c
>>> +++ b/drivers/gpu/drm/tegra/plane.c
>>> @@ -287,13 +287,11 @@ unsigned int tegra_plane_format_adjust(unsigned int opaque)
>>>  	return opaque;
>>>  }
>>>  
>>> -unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane,
>>> -					   struct tegra_plane *other)
>>> +static unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane,
>>> +						  struct tegra_plane *other)
>>
>> I'd prefer this to be a separate patch to keep the diff down to make
>> this easier to apply to v4.16. I can do that when I apply, no need to
>> resend.
> 
> Okay. But now I'm thinking that it's probably not really worth to backport this
> patch at all because it doesn't fix blending entirely, but only makes it good
> enough to show cursor plane properly. I'll send V2.

Ah, didn't notice that I don't have to re-send. I've spotted other problem in
the patch, so will just send V2 ;)

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

* Re: [PATCH v1 2/3] drm/tegra: plane: Correct legacy blending
  2018-03-15 12:42     ` Dmitry Osipenko
  2018-03-15 13:47       ` Dmitry Osipenko
@ 2018-03-15 13:47       ` Dmitry Osipenko
  1 sibling, 0 replies; 13+ messages in thread
From: Dmitry Osipenko @ 2018-03-15 13:47 UTC (permalink / raw)
  To: Thierry Reding; +Cc: dri-devel, linux-tegra, linux-kernel

On 15.03.2018 15:42, Dmitry Osipenko wrote:
> On 15.03.2018 13:29, Thierry Reding wrote:
>> On Thu, Mar 15, 2018 at 04:00:24AM +0300, Dmitry Osipenko wrote:
>>> Keep old 'dependent' state of unaffected planes, this way new state takes
>>> into account current state of unaffected planes.
>>>
>>> Fixes: ebae8d07435a ("drm/tegra: dc: Implement legacy blending")
>>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>>> ---
>>>  drivers/gpu/drm/tegra/plane.c | 15 ++++++---------
>>>  1 file changed, 6 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
>>> index fc37dcf8c458..3c0cb6a04c66 100644
>>> --- a/drivers/gpu/drm/tegra/plane.c
>>> +++ b/drivers/gpu/drm/tegra/plane.c
>>> @@ -287,13 +287,11 @@ unsigned int tegra_plane_format_adjust(unsigned int opaque)
>>>  	return opaque;
>>>  }
>>>  
>>> -unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane,
>>> -					   struct tegra_plane *other)
>>> +static unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane,
>>> +						  struct tegra_plane *other)
>>
>> I'd prefer this to be a separate patch to keep the diff down to make
>> this easier to apply to v4.16. I can do that when I apply, no need to
>> resend.
> 
> Okay. But now I'm thinking that it's probably not really worth to backport this
> patch at all because it doesn't fix blending entirely, but only makes it good
> enough to show cursor plane properly. I'll send V2.

Ah, didn't notice that I don't have to re-send. I've spotted other problem in
the patch, so will just send V2 ;)

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

* Re: [PATCH v1 3/3] drm/tegra: dc: Dedicate overlay plane to cursor on older Tegra's
  2018-03-15 10:45   ` Thierry Reding
@ 2018-03-16  7:36     ` Daniel Vetter
  2018-03-17 15:22       ` Dmitry Osipenko
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Vetter @ 2018-03-16  7:36 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Dmitry Osipenko, linux-tegra, Linux Kernel Mailing List, dri-devel

On Thu, Mar 15, 2018 at 11:45 AM, Thierry Reding
<thierry.reding@gmail.com> wrote:
> On Thu, Mar 15, 2018 at 04:00:25AM +0300, Dmitry Osipenko wrote:
>> Older Tegra's do not support RGBA format for the cursor, but instead
>> overlay plane could be used for it. Since there is no much use for the
>> overlays on a regular desktop and HW-accelerated cursor is much better
>> than a SW cursor, let's dedicate one overlay plane to the mouse cursor.
>>
>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>> ---
>>  drivers/gpu/drm/tegra/dc.c | 28 +++++++++++++++++++++++-----
>>  1 file changed, 23 insertions(+), 5 deletions(-)
>
> Applied. I'm not entirely happy that we need to sacrifice one of the
> overlay windows for this, but you're right, it's probably okay given
> how little planes are used on a regular desktop.
>
> We could always provide a module parameter to switch this on and off
> if that's ever something we want.

The idea with universal planes is that you can (at least try to) use
the cursor overlay plane as a normal plane. It is only a hint to
userspace, there's no requirement anywhere in atomic that you only use
it as a cursor. That way desktops get a good hint for what the cursor
plane should be, everyone else can still use all the planes.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH v1 3/3] drm/tegra: dc: Dedicate overlay plane to cursor on older Tegra's
  2018-03-16  7:36     ` Daniel Vetter
@ 2018-03-17 15:22       ` Dmitry Osipenko
  0 siblings, 0 replies; 13+ messages in thread
From: Dmitry Osipenko @ 2018-03-17 15:22 UTC (permalink / raw)
  To: Daniel Vetter, Thierry Reding
  Cc: linux-tegra, Linux Kernel Mailing List, dri-devel

On 16.03.2018 10:36, Daniel Vetter wrote:
> On Thu, Mar 15, 2018 at 11:45 AM, Thierry Reding
> <thierry.reding@gmail.com> wrote:
>> On Thu, Mar 15, 2018 at 04:00:25AM +0300, Dmitry Osipenko wrote:
>>> Older Tegra's do not support RGBA format for the cursor, but instead
>>> overlay plane could be used for it. Since there is no much use for the
>>> overlays on a regular desktop and HW-accelerated cursor is much better
>>> than a SW cursor, let's dedicate one overlay plane to the mouse cursor.
>>>
>>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>>> ---
>>>  drivers/gpu/drm/tegra/dc.c | 28 +++++++++++++++++++++++-----
>>>  1 file changed, 23 insertions(+), 5 deletions(-)
>>
>> Applied. I'm not entirely happy that we need to sacrifice one of the
>> overlay windows for this, but you're right, it's probably okay given
>> how little planes are used on a regular desktop.
>>
>> We could always provide a module parameter to switch this on and off
>> if that's ever something we want.
> 
> The idea with universal planes is that you can (at least try to) use
> the cursor overlay plane as a normal plane. It is only a hint to
> userspace, there's no requirement anywhere in atomic that you only use
> it as a cursor. That way desktops get a good hint for what the cursor
> plane should be, everyone else can still use all the planes.

Indeed, thank you for pointing at it. That is a nice feature.

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

end of thread, other threads:[~2018-03-17 15:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-15  1:00 [PATCH v1 1/3] drm/tegra: plane: Fix RGB565 plane format on older Tegra's Dmitry Osipenko
2018-03-15  1:00 ` [PATCH v1 2/3] drm/tegra: plane: Correct legacy blending Dmitry Osipenko
2018-03-15 10:29   ` Thierry Reding
2018-03-15 12:42     ` Dmitry Osipenko
2018-03-15 13:47       ` Dmitry Osipenko
2018-03-15 13:47       ` Dmitry Osipenko
2018-03-15  1:00 ` [PATCH v1 3/3] drm/tegra: dc: Dedicate overlay plane to cursor on older Tegra's Dmitry Osipenko
2018-03-15 10:45   ` Thierry Reding
2018-03-16  7:36     ` Daniel Vetter
2018-03-17 15:22       ` Dmitry Osipenko
2018-03-15 10:27 ` [PATCH v1 1/3] drm/tegra: plane: Fix RGB565 plane format " Thierry Reding
2018-03-15 12:48   ` Dmitry Osipenko
2018-03-15 12:58     ` Dmitry Osipenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).