2023-03-10 13:00:44

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH] drm/virtio: Enable fb damage clips property for the primary plane

Christian Hergert reports that the driver doesn't enable the property and
that leads to always doing a full plane update, even when the driver does
support damage clipping for the primary plane.

Don't enable it for the cursor plane, because its .atomic_update callback
doesn't handle damage clips.

Reported-by: Christian Hergert <[email protected]>
Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/virtio/virtgpu_plane.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
index 4c09e313bebc..a2e045f3a000 100644
--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -390,5 +390,9 @@ struct drm_plane *virtio_gpu_plane_init(struct virtio_gpu_device *vgdev,
return plane;

drm_plane_helper_add(plane, funcs);
+
+ if (type == DRM_PLANE_TYPE_PRIMARY)
+ drm_plane_enable_fb_damage_clips(plane);
+
return plane;
}

base-commit: 3e853b9f89e4bcc8aa342fa350d83ff0df67d7e9
--
2.39.2



2023-03-10 13:20:36

by Thomas Zimmermann

[permalink] [raw]
Subject: Re: [PATCH] drm/virtio: Enable fb damage clips property for the primary plane

Hi Javier

Am 10.03.23 um 13:59 schrieb Javier Martinez Canillas:
> Christian Hergert reports that the driver doesn't enable the property and
> that leads to always doing a full plane update, even when the driver does
> support damage clipping for the primary plane.
>
> Don't enable it for the cursor plane, because its .atomic_update callback
> doesn't handle damage clips.
>
> Reported-by: Christian Hergert <[email protected]>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---
>
> drivers/gpu/drm/virtio/virtgpu_plane.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
> index 4c09e313bebc..a2e045f3a000 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_plane.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
> @@ -390,5 +390,9 @@ struct drm_plane *virtio_gpu_plane_init(struct virtio_gpu_device *vgdev,

virtio_gpu_plane_init() should really be two separate functions. But
withing the constrains of the current code

Reviewed-by: Thomas Zimmermann <[email protected]>

Best regards
Thomas

> return plane;
>
> drm_plane_helper_add(plane, funcs);
> +
> + if (type == DRM_PLANE_TYPE_PRIMARY)
> + drm_plane_enable_fb_damage_clips(plane);
> +
> return plane;
> }
>
> base-commit: 3e853b9f89e4bcc8aa342fa350d83ff0df67d7e9

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev


Attachments:
OpenPGP_signature (840.00 B)
OpenPGP digital signature

2023-03-10 13:28:36

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH] drm/virtio: Enable fb damage clips property for the primary plane

Thomas Zimmermann <[email protected]> writes:

Hello Thomas,

> Hi Javier
>
> Am 10.03.23 um 13:59 schrieb Javier Martinez Canillas:
>> Christian Hergert reports that the driver doesn't enable the property and
>> that leads to always doing a full plane update, even when the driver does
>> support damage clipping for the primary plane.
>>
>> Don't enable it for the cursor plane, because its .atomic_update callback
>> doesn't handle damage clips.
>>
>> Reported-by: Christian Hergert <[email protected]>
>> Signed-off-by: Javier Martinez Canillas <[email protected]>
>> ---
>>
>> drivers/gpu/drm/virtio/virtgpu_plane.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
>> index 4c09e313bebc..a2e045f3a000 100644
>> --- a/drivers/gpu/drm/virtio/virtgpu_plane.c
>> +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
>> @@ -390,5 +390,9 @@ struct drm_plane *virtio_gpu_plane_init(struct virtio_gpu_device *vgdev,
>
> virtio_gpu_plane_init() should really be two separate functions. But
> withing the constrains of the current code
>

Agreed, I thought the same. I may post a follow-up patch once this lands.

> Reviewed-by: Thomas Zimmermann <[email protected]>
>

Thanks!

--
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


2023-03-13 08:57:02

by Gerd Hoffmann

[permalink] [raw]
Subject: Re: [PATCH] drm/virtio: Enable fb damage clips property for the primary plane

On Fri, Mar 10, 2023 at 01:59:42PM +0100, Javier Martinez Canillas wrote:
> Christian Hergert reports that the driver doesn't enable the property and
> that leads to always doing a full plane update, even when the driver does
> support damage clipping for the primary plane.
>
> Don't enable it for the cursor plane, because its .atomic_update callback
> doesn't handle damage clips.
>
> Reported-by: Christian Hergert <[email protected]>
> Signed-off-by: Javier Martinez Canillas <[email protected]>

Acked-by: Gerd Hoffmann <[email protected]>


2023-03-13 17:30:14

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH] drm/virtio: Enable fb damage clips property for the primary plane

Javier Martinez Canillas <[email protected]> writes:

> Christian Hergert reports that the driver doesn't enable the property and
> that leads to always doing a full plane update, even when the driver does
> support damage clipping for the primary plane.
>
> Don't enable it for the cursor plane, because its .atomic_update callback
> doesn't handle damage clips.
>
> Reported-by: Christian Hergert <[email protected]>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---

Pushed to drm-misc (drm-misc-next). Thanks!

--
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat