mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: dri-devel@lists.freedesktop.org
Cc: Gurchetan Singh <gurchetansingh@chromium.org>,
	Gerd Hoffmann <kraxel@redhat.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	virtualization@lists.linux-foundation.org (open list:VIRTIO GPU
	DRIVER), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 5/5] drm/virtio: factor out virtio_gpu_update_dumb_bo
Date: Tue, 22 Oct 2019 10:05:46 +0200	[thread overview]
Message-ID: <20191022080546.19769-6-kraxel@redhat.com> (raw)
In-Reply-To: <20191022080546.19769-1-kraxel@redhat.com>

No functional change.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/virtio/virtgpu_plane.c | 36 +++++++++++++++-----------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
index 0b5a760bc293..bc4bc4475a8c 100644
--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -102,6 +102,25 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane,
 	return ret;
 }
 
+static void virtio_gpu_update_dumb_bo(struct virtio_gpu_device *vgdev,
+				      struct virtio_gpu_object *bo,
+				      struct drm_plane_state *state)
+{
+	struct virtio_gpu_object_array *objs;
+
+	objs = virtio_gpu_array_alloc(1);
+	if (!objs)
+		return;
+	virtio_gpu_array_add_obj(objs, &bo->base.base);
+	virtio_gpu_cmd_transfer_to_host_2d
+		(vgdev, 0,
+		 state->src_w >> 16,
+		 state->src_h >> 16,
+		 state->src_x >> 16,
+		 state->src_y >> 16,
+		 objs, NULL);
+}
+
 static void virtio_gpu_primary_plane_update(struct drm_plane *plane,
 					    struct drm_plane_state *old_state)
 {
@@ -129,21 +148,8 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane,
 
 	vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
 	bo = gem_to_virtio_gpu_obj(vgfb->base.obj[0]);
-	if (bo->dumb) {
-		struct virtio_gpu_object_array *objs;
-
-		objs = virtio_gpu_array_alloc(1);
-		if (!objs)
-			return;
-		virtio_gpu_array_add_obj(objs, vgfb->base.obj[0]);
-		virtio_gpu_cmd_transfer_to_host_2d
-			(vgdev, 0,
-			 plane->state->src_w >> 16,
-			 plane->state->src_h >> 16,
-			 plane->state->src_x >> 16,
-			 plane->state->src_y >> 16,
-			 objs, NULL);
-	}
+	if (bo->dumb)
+		virtio_gpu_update_dumb_bo(vgdev, bo, plane->state);
 
 	DRM_DEBUG("handle 0x%x, crtc %dx%d+%d+%d, src %dx%d+%d+%d\n",
 		  bo->hw_res_handle,
-- 
2.18.1


      parent reply	other threads:[~2019-10-22  8:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191022080546.19769-1-kraxel@redhat.com>
2019-10-22  8:05 ` [PATCH 1/5] drm/virtio: print a single line with device features Gerd Hoffmann
2019-10-22  8:05 ` [PATCH 2/5] drm/virtio: move byteorder handling into virtio_gpu_cmd_transfer_to_host_2d function Gerd Hoffmann
2019-10-22  8:05 ` [PATCH 3/5] drm/virtio: fix byteorder handling in virtio_gpu_cmd_transfer_{from,to}_host_3d functions Gerd Hoffmann
2019-10-22  8:05 ` [PATCH 4/5] drm/virtio: Simplify virtio_gpu_primary_plane_update workflow Gerd Hoffmann
2019-10-22  8:05 ` Gerd Hoffmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191022080546.19769-6-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gurchetansingh@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®