Linux virtualization list
 help / color / mirror / Atom feed
* [PATCH 4/4] drm/qxl: add drm_gem_plane_helper_prepare_fb
       [not found] <20220429134230.24334-1-christian.koenig@amd.com>
@ 2022-04-29 13:42 ` Christian König
  2022-05-04  9:27   ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Christian König @ 2022-04-29 13:42 UTC (permalink / raw)
  To: daniel.vetter, dri-devel
  Cc: spice-devel, Dave Airlie, virtualization, Christian König

We could need to wait for the pin to complete here.

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Cc: spice-devel@lists.freedesktop.org
---
 drivers/gpu/drm/qxl/qxl_display.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index 9a9c29b1d3e1..9a64fa4c7530 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -34,6 +34,7 @@
 #include <drm/drm_plane_helper.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_simple_kms_helper.h>
+#include <drm/drm_gem_atomic_helper.h>
 
 #include "qxl_drv.h"
 #include "qxl_object.h"
@@ -829,6 +830,7 @@ static int qxl_plane_prepare_fb(struct drm_plane *plane,
 	struct qxl_device *qdev = to_qxl(plane->dev);
 	struct drm_gem_object *obj;
 	struct qxl_bo *user_bo;
+	int ret;
 
 	if (!new_state->fb)
 		return 0;
@@ -852,7 +854,11 @@ static int qxl_plane_prepare_fb(struct drm_plane *plane,
 		qxl_free_cursor(old_cursor_bo);
 	}
 
-	return qxl_bo_pin(user_bo);
+	ret = qxl_bo_pin(user_bo);
+	if (ret)
+		return ret;
+
+	return drm_gem_plane_helper_prepare_fb(plane, new_state);
 }
 
 static void qxl_plane_cleanup_fb(struct drm_plane *plane,
-- 
2.25.1

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* Re: [PATCH 4/4] drm/qxl: add drm_gem_plane_helper_prepare_fb
  2022-04-29 13:42 ` [PATCH 4/4] drm/qxl: add drm_gem_plane_helper_prepare_fb Christian König
@ 2022-05-04  9:27   ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2022-05-04  9:27 UTC (permalink / raw)
  To: Christian König
  Cc: daniel.vetter, dri-devel, virtualization, spice-devel,
	Dave Airlie, Christian König

On Fri, Apr 29, 2022 at 03:42:30PM +0200, Christian König wrote:
> We could need to wait for the pin to complete here.
> 
> Signed-off-by: Christian König <christian.koenig@amd.com>
> Cc: Dave Airlie <airlied@redhat.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: virtualization@lists.linux-foundation.org
> Cc: spice-devel@lists.freedesktop.org

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/qxl/qxl_display.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
> index 9a9c29b1d3e1..9a64fa4c7530 100644
> --- a/drivers/gpu/drm/qxl/qxl_display.c
> +++ b/drivers/gpu/drm/qxl/qxl_display.c
> @@ -34,6 +34,7 @@
>  #include <drm/drm_plane_helper.h>
>  #include <drm/drm_probe_helper.h>
>  #include <drm/drm_simple_kms_helper.h>
> +#include <drm/drm_gem_atomic_helper.h>
>  
>  #include "qxl_drv.h"
>  #include "qxl_object.h"
> @@ -829,6 +830,7 @@ static int qxl_plane_prepare_fb(struct drm_plane *plane,
>  	struct qxl_device *qdev = to_qxl(plane->dev);
>  	struct drm_gem_object *obj;
>  	struct qxl_bo *user_bo;
> +	int ret;
>  
>  	if (!new_state->fb)
>  		return 0;
> @@ -852,7 +854,11 @@ static int qxl_plane_prepare_fb(struct drm_plane *plane,
>  		qxl_free_cursor(old_cursor_bo);
>  	}
>  
> -	return qxl_bo_pin(user_bo);
> +	ret = qxl_bo_pin(user_bo);
> +	if (ret)
> +		return ret;
> +
> +	return drm_gem_plane_helper_prepare_fb(plane, new_state);
>  }
>  
>  static void qxl_plane_cleanup_fb(struct drm_plane *plane,
> -- 
> 2.25.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

end of thread, other threads:[~2022-05-04  9:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20220429134230.24334-1-christian.koenig@amd.com>
2022-04-29 13:42 ` [PATCH 4/4] drm/qxl: add drm_gem_plane_helper_prepare_fb Christian König
2022-05-04  9:27   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox