drm/qxl: use shadow bo directly
Pass the shadow bo to qxl_io_create_primary() instead of expecting qxl_io_create_primary to check bo->shadow. Set is_primary flag on the shadow bo. Move the is_primary tracking into qxl_io_create_primary() and qxl_io_destroy_primary() functions. That simplifies primary surface tracking and the workflow in qxl_primary_atomic_update(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Noralf Trønnes <noralf@tronnes.org> Link: http://patchwork.freedesktop.org/patch/msgid/20190118122020.27596-14-kraxel@redhat.com qxl_io_create/destroy_primary: primary_bo tracking [fixup]
This commit is contained in:
@@ -374,6 +374,8 @@ void qxl_io_flush_surfaces(struct qxl_device *qdev)
|
||||
void qxl_io_destroy_primary(struct qxl_device *qdev)
|
||||
{
|
||||
wait_for_io_cmd(qdev, 0, QXL_IO_DESTROY_PRIMARY_ASYNC);
|
||||
qdev->primary_bo->is_primary = false;
|
||||
drm_gem_object_put_unlocked(&qdev->primary_bo->gem_base);
|
||||
qdev->primary_bo = NULL;
|
||||
}
|
||||
|
||||
@@ -390,11 +392,7 @@ void qxl_io_create_primary(struct qxl_device *qdev, struct qxl_bo *bo)
|
||||
create->width = bo->surf.width;
|
||||
create->height = bo->surf.height;
|
||||
create->stride = bo->surf.stride;
|
||||
if (bo->shadow) {
|
||||
create->mem = qxl_bo_physical_address(qdev, bo->shadow, 0);
|
||||
} else {
|
||||
create->mem = qxl_bo_physical_address(qdev, bo, 0);
|
||||
}
|
||||
create->mem = qxl_bo_physical_address(qdev, bo, 0);
|
||||
|
||||
DRM_DEBUG_DRIVER("mem = %llx, from %p\n", create->mem, bo->kptr);
|
||||
|
||||
@@ -403,6 +401,8 @@ void qxl_io_create_primary(struct qxl_device *qdev, struct qxl_bo *bo)
|
||||
|
||||
wait_for_io_cmd(qdev, 0, QXL_IO_CREATE_PRIMARY_ASYNC);
|
||||
qdev->primary_bo = bo;
|
||||
qdev->primary_bo->is_primary = true;
|
||||
drm_gem_object_get(&qdev->primary_bo->gem_base);
|
||||
}
|
||||
|
||||
void qxl_io_memslot_add(struct qxl_device *qdev, uint8_t id)
|
||||
|
Reference in New Issue
Block a user