diff mbox series

[1/4] mgag200: Add FB_DAMAGE_CLIPS support

Message ID 20220426164108.1051295-2-jfalempe@redhat.com (mailing list archive)
State New, archived
Headers show
Series mgag200: Improve damage handling | expand

Commit Message

Jocelyn Falempe April 26, 2022, 4:41 p.m. UTC
The driver does support damage clips, but doesn't advertise it.
So when running gnome/wayland on Matrox hardware, the full frame is
copied to the slow Matrox memory, which leads to very poor performances.

Add drm_plane_enable_fb_damage_clips() to advertise this capability to
userspace.

With this patch, gnome/wayland becomes usable on Matrox GPU.

Suggested-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
---
 drivers/gpu/drm/mgag200/mgag200_mode.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Thomas Zimmermann May 4, 2022, 9:58 a.m. UTC | #1
Am 26.04.22 um 18:41 schrieb Jocelyn Falempe:
> The driver does support damage clips, but doesn't advertise it.
> So when running gnome/wayland on Matrox hardware, the full frame is
> copied to the slow Matrox memory, which leads to very poor performances.
> 
> Add drm_plane_enable_fb_damage_clips() to advertise this capability to
> userspace.
> 
> With this patch, gnome/wayland becomes usable on Matrox GPU.
> 
> Suggested-by: Jonas Ådahl <jadahl@gmail.com>
> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/gpu/drm/mgag200/mgag200_mode.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
> index 6e18d3bbd720..cff2e76f3fa0 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_mode.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
> @@ -1107,6 +1107,8 @@ int mgag200_modeset_init(struct mga_device *mdev)
>   		return ret;
>   	}
>   
> +	drm_plane_enable_fb_damage_clips(&pipe->plane);
> +
>   	/* FIXME: legacy gamma tables; convert to CRTC state */
>   	drm_mode_crtc_set_gamma_size(&pipe->crtc, MGAG200_LUT_SIZE);
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 6e18d3bbd720..cff2e76f3fa0 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -1107,6 +1107,8 @@  int mgag200_modeset_init(struct mga_device *mdev)
 		return ret;
 	}
 
+	drm_plane_enable_fb_damage_clips(&pipe->plane);
+
 	/* FIXME: legacy gamma tables; convert to CRTC state */
 	drm_mode_crtc_set_gamma_size(&pipe->crtc, MGAG200_LUT_SIZE);