Skip to contentSkip to conversation

virtio-gpu: Fixes for atomic support

PATCH In review Rob Herring 2 participants 7 messages Jan 13, 2016 – Feb 1, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover virtio-gpu: Fixes for atomic support

Dave,

This series is the minimal changes to get virtio-gpu working with Android DRM based hwcomposer. The first 3 patches are fixes, but I assume they are only hit if using the atomic APIs which is dependent on the 4th patch. I suspect async commit support is also missing, but Android doesn't seem to need it.

I also have a few more patches for fb emulation to support panning and mmapping the framebuffer. I'm not too sure that is really worth supporting though.

Rob

Rob Herring (4):
drm: virtio-gpu: get the fb from the plane state for atomic updates
drm: virtio-gpu: ensure plane is flushed to host on atomic update
drm: virtio-gpu: transfer dumb buffers to host on plane update
drm: virtio-gpu: set atomic flag

 drivers/gpu/drm/virtio/virtgpu_drv.c   |  2 +-
 drivers/gpu/drm/virtio/virtgpu_plane.c | 16 ++++++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 1/4 drm: virtio-gpu: get the fb from the plane state for atomic updates

When using the atomic API, plane->fb is not set when calling virtio_gpu_plane_atomic_update. Use plane->state->fb instead.

---
 drivers/gpu/drm/virtio/virtgpu_plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/virtio/virtgpu_plane.c +2 -2
index 4a74129..6b9ad59 100644
@@ -68,8 +68,8 @@ static void virtio_gpu_plane_atomic_update(struct drm_plane *plane,
 	struct virtio_gpu_object *bo;
 	uint32_t handle;
 
-	if (plane->fb) {
-		vgfb = to_virtio_gpu_framebuffer(plane->fb);
+	if (plane->state->fb) {
+		vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
 		bo = gem_to_virtio_gpu_obj(vgfb->obj);
 		handle = bo->hw_res_handle;
 	} else {
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

PATCH 2/4 drm: virtio-gpu: ensure plane is flushed to host on atomic update

In reply to Rob Herring

This fixes drawing updates when updating planes with atomic API.

---
 drivers/gpu/drm/virtio/virtgpu_plane.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/virtio/virtgpu_plane.c +5 -0
index 6b9ad59..af121cf 100644
@@ -84,6 +84,11 @@ static void virtio_gpu_plane_atomic_update(struct drm_plane *plane,
 				   plane->state->crtc_h,
 				   plane->state->crtc_x,
 				   plane->state->crtc_y);
+	virtio_gpu_cmd_resource_flush(vgdev, handle,
+				      plane->state->crtc_x,
+				      plane->state->crtc_y,
+				      plane->state->crtc_w,
+				      plane->state->crtc_h);
 }
 
 
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

PATCH 3/4 drm: virtio-gpu: transfer dumb buffers to host on plane update

In reply to Rob Herring

For dumb buffers, we need to transfer them to the host when updating a plane.

---
 drivers/gpu/drm/virtio/virtgpu_plane.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/virtio/virtgpu_plane.c +7 -0
index af121cf..7b6e5c5 100644
@@ -72,6 +72,13 @@ static void virtio_gpu_plane_atomic_update(struct drm_plane *plane,
 		vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
 		bo = gem_to_virtio_gpu_obj(vgfb->obj);
 		handle = bo->hw_res_handle;
+		if (bo->dumb) {
+			virtio_gpu_cmd_transfer_to_host_2d
+				(vgdev, handle, 0,
+				 cpu_to_le32(plane->state->crtc_w),
+				 cpu_to_le32(plane->state->crtc_h),
+				 plane->state->crtc_x, plane->state->crtc_y, NULL);
+		}
 	} else {
 		handle = 0;
 	}
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

PATCH 4/4 drm: virtio-gpu: set atomic flag

In reply to Rob Herring

Advertise atomic mode setting capability to user space.

---
 drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/virtio/virtgpu_drv.c +1 -1
index b40ed60..7f898cf 100644
@@ -118,7 +118,7 @@ static const struct file_operations virtio_gpu_driver_fops = {
 
 
 static struct drm_driver driver = {
-	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | DRIVER_RENDER,
+	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | DRIVER_RENDER | DRIVER_ATOMIC,
 	.set_busid = drm_virtio_set_busid,
 	.load = virtio_gpu_driver_load,
 	.unload = virtio_gpu_driver_unload,
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw
In reply to Rob Herring
Quoted 20 lines · Rob Herring

Dave,

This series is the minimal changes to get virtio-gpu working with Android DRM based hwcomposer. The first 3 patches are fixes, but I assume they are only hit if using the atomic APIs which is dependent on the 4th patch. I suspect async commit support is also missing, but Android doesn't seem to need it.

I also have a few more patches for fb emulation to support panning and mmapping the framebuffer. I'm not too sure that is really worth supporting though.

Rob

Rob Herring (4):
drm: virtio-gpu: get the fb from the plane state for atomic updates
drm: virtio-gpu: ensure plane is flushed to host on atomic update
drm: virtio-gpu: transfer dumb buffers to host on plane update
drm: virtio-gpu: set atomic flag

Quoted 3 lines
 drivers/gpu/drm/virtio/virtgpu_drv.c   |  2 +-
 drivers/gpu/drm/virtio/virtgpu_plane.c | 16 ++++++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

Ping on this series.

Rob
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#6 lore raw
Quoted 21 lines · Rob Herring
Quoted 20 lines · Rob Herring

Dave,

This series is the minimal changes to get virtio-gpu working with Android DRM based hwcomposer. The first 3 patches are fixes, but I assume they are only hit if using the atomic APIs which is dependent on the 4th patch. I suspect async commit support is also missing, but Android doesn't seem to need it.

I also have a few more patches for fb emulation to support panning and mmapping the framebuffer. I'm not too sure that is really worth supporting though.

Rob

Rob Herring (4):
drm: virtio-gpu: get the fb from the plane state for atomic updates
drm: virtio-gpu: ensure plane is flushed to host on atomic update
drm: virtio-gpu: transfer dumb buffers to host on plane update
drm: virtio-gpu: set atomic flag

Quoted 5 lines
Quoted 3 lines
 drivers/gpu/drm/virtio/virtgpu_drv.c   |  2 +-
 drivers/gpu/drm/virtio/virtgpu_plane.c | 16 ++++++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

Ping on this series.

Hey,

I was going to put them in drm-next when I start doing drm-next.

I didn't think they were urgent enough for -fixes at this point.

Dave.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel