search for: display_info_lock

Displaying 20 results from an estimated 27 matches for "display_info_lock".

2019 Apr 05
3
[PATCH] drm/virtio: move drm_connector_update_edid_property() call
...11 @@ static void virtio_gpu_cmd_get_edid_cb(struct virtio_gpu_device *vgdev, output = vgdev->outputs + scanout; new_edid = drm_do_get_edid(&output->conn, virtio_get_edid_block, resp); + drm_connector_update_edid_property(&output->conn, new_edid); spin_lock(&vgdev->display_info_lock); old_edid = output->edid; output->edid = new_edid; - drm_connector_update_edid_property(&output->conn, output->edid); spin_unlock(&vgdev->display_info_lock); kfree(old_edid); -- 2.18.1
2019 Jun 05
10
[PATCH 1/4] drm/virtio: Ensure cached capset entries are valid before copying.
...t virtio_gpu_get_caps_ioctl(struct drm_device *dev, list_for_each_entry(cache_ent, &vgdev->cap_cache, head) { if (cache_ent->id == args->cap_set_id && cache_ent->version == args->cap_set_ver) { - ptr = cache_ent->caps_cache; spin_unlock(&vgdev->display_info_lock); goto copy_exit; } @@ -537,6 +536,7 @@ static int virtio_gpu_get_caps_ioctl(struct drm_device *dev, virtio_gpu_cmd_get_capset(vgdev, found_valid, args->cap_set_ver, &cache_ent); +copy_exit: ret = wait_event_timeout(vgdev->resp_wq, atomic_read(&cache_ent->...
2015 Sep 21
2
[PATCH v2 4/6] virtio-gpu: add 3d/virgl support
...{ + struct virtio_gpu_device *vgdev = dev->dev_private; + struct drm_virtgpu_get_caps *args = data; + int size; + int i; + int found_valid = -1; + int ret; + struct virtio_gpu_drv_cap_cache *cache_ent; + void *ptr; + if (vgdev->num_capsets == 0) + return -ENOSYS; + + spin_lock(&vgdev->display_info_lock); + for (i = 0; i < vgdev->num_capsets; i++) { + if (vgdev->capsets[i].id == args->cap_set_id) { + if (vgdev->capsets[i].max_version >= args->cap_set_ver) { + found_valid = i; + break; + } + } + } + + if (found_valid == -1) { + spin_unlock(&vgdev->display_in...
2015 Sep 21
2
[PATCH v2 4/6] virtio-gpu: add 3d/virgl support
...{ + struct virtio_gpu_device *vgdev = dev->dev_private; + struct drm_virtgpu_get_caps *args = data; + int size; + int i; + int found_valid = -1; + int ret; + struct virtio_gpu_drv_cap_cache *cache_ent; + void *ptr; + if (vgdev->num_capsets == 0) + return -ENOSYS; + + spin_lock(&vgdev->display_info_lock); + for (i = 0; i < vgdev->num_capsets; i++) { + if (vgdev->capsets[i].id == args->cap_set_id) { + if (vgdev->capsets[i].max_version >= args->cap_set_ver) { + found_valid = i; + break; + } + } + } + + if (found_valid == -1) { + spin_unlock(&vgdev->display_in...
2015 Oct 02
0
[PATCH v3 4/7] virtio-gpu: add 3d/virgl support
...{ + struct virtio_gpu_device *vgdev = dev->dev_private; + struct drm_virtgpu_get_caps *args = data; + int size; + int i; + int found_valid = -1; + int ret; + struct virtio_gpu_drv_cap_cache *cache_ent; + void *ptr; + if (vgdev->num_capsets == 0) + return -ENOSYS; + + spin_lock(&vgdev->display_info_lock); + for (i = 0; i < vgdev->num_capsets; i++) { + if (vgdev->capsets[i].id == args->cap_set_id) { + if (vgdev->capsets[i].max_version >= args->cap_set_ver) { + found_valid = i; + break; + } + } + } + + if (found_valid == -1) { + spin_unlock(&vgdev->display_in...
2015 Oct 02
0
[PATCH v3 4/7] virtio-gpu: add 3d/virgl support
...{ + struct virtio_gpu_device *vgdev = dev->dev_private; + struct drm_virtgpu_get_caps *args = data; + int size; + int i; + int found_valid = -1; + int ret; + struct virtio_gpu_drv_cap_cache *cache_ent; + void *ptr; + if (vgdev->num_capsets == 0) + return -ENOSYS; + + spin_lock(&vgdev->display_info_lock); + for (i = 0; i < vgdev->num_capsets; i++) { + if (vgdev->capsets[i].id == args->cap_set_id) { + if (vgdev->capsets[i].max_version >= args->cap_set_ver) { + found_valid = i; + break; + } + } + } + + if (found_valid == -1) { + spin_unlock(&vgdev->display_in...
2015 Sep 21
0
[PATCH v2 4/6] virtio-gpu: add 3d/virgl support
...te; > + struct drm_virtgpu_get_caps *args = data; > + int size; > + int i; > + int found_valid = -1; > + int ret; > + struct virtio_gpu_drv_cap_cache *cache_ent; > + void *ptr; > + if (vgdev->num_capsets == 0) > + return -ENOSYS; > + > + spin_lock(&vgdev->display_info_lock); > + for (i = 0; i < vgdev->num_capsets; i++) { > + if (vgdev->capsets[i].id == args->cap_set_id) { > + if (vgdev->capsets[i].max_version >= args->cap_set_ver) { > + found_valid = i; > + break; > + } > + } > + } > + > + if (found_valid...
2015 Sep 09
3
[PATCH 3/5] update virtio gpu driver: add 3d/virgl support
...{ + struct virtio_gpu_device *vgdev = dev->dev_private; + struct drm_virtgpu_get_caps *args = data; + int size; + int i; + int found_valid = -1; + int ret; + struct virtio_gpu_drv_cap_cache *cache_ent; + void *ptr; + if (vgdev->num_capsets == 0) + return -ENOSYS; + + spin_lock(&vgdev->display_info_lock); + for (i = 0; i < vgdev->num_capsets; i++) { + if (vgdev->capsets[i].id == args->cap_set_id) { + if (vgdev->capsets[i].max_version >= args->cap_set_ver) { + found_valid = i; + break; + } + } + } + + if (found_valid == -1) { + spin_unlock(&vgdev->display_in...
2015 Sep 09
3
[PATCH 3/5] update virtio gpu driver: add 3d/virgl support
...{ + struct virtio_gpu_device *vgdev = dev->dev_private; + struct drm_virtgpu_get_caps *args = data; + int size; + int i; + int found_valid = -1; + int ret; + struct virtio_gpu_drv_cap_cache *cache_ent; + void *ptr; + if (vgdev->num_capsets == 0) + return -ENOSYS; + + spin_lock(&vgdev->display_info_lock); + for (i = 0; i < vgdev->num_capsets; i++) { + if (vgdev->capsets[i].id == args->cap_set_id) { + if (vgdev->capsets[i].max_version >= args->cap_set_ver) { + found_valid = i; + break; + } + } + } + + if (found_valid == -1) { + spin_unlock(&vgdev->display_in...
2015 Jun 16
0
[PATCH 2/3] drm/virtgpu: initialise fbdev after getting initial display info
...u/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index e5a2c09..ff8de3d 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -171,6 +171,7 @@ struct virtio_gpu_device { wait_queue_head_t resp_wq; /* current display info */ spinlock_t display_info_lock; + bool display_info_pending; struct virtio_gpu_fence_driver fence_drv; diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c index 132405f..782766c 100644 --- a/drivers/gpu/drm/virtio/virtgpu_kms.c +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c @@ -137,9 +137,1...
2019 Jun 26
0
[PATCH] drm/virtio: move drm_connector_update_edid_property() call
...md_get_edid_cb(struct virtio_gpu_device *vgdev, > output = vgdev->outputs + scanout; > > new_edid = drm_do_get_edid(&output->conn, virtio_get_edid_block, resp); > + drm_connector_update_edid_property(&output->conn, new_edid); > > spin_lock(&vgdev->display_info_lock); > old_edid = output->edid; > output->edid = new_edid; > - drm_connector_update_edid_property(&output->conn, output->edid); > spin_unlock(&vgdev->display_info_lock); > > kfree(old_edid); This gets rid of the sleeping while atomic traces I've...
2019 Jul 10
0
[PATCH AUTOSEL 5.1 03/11] drm/virtio: move drm_connector_update_edid_property() call
...11 @@ static void virtio_gpu_cmd_get_edid_cb(struct virtio_gpu_device *vgdev, output = vgdev->outputs + scanout; new_edid = drm_do_get_edid(&output->conn, virtio_get_edid_block, resp); + drm_connector_update_edid_property(&output->conn, new_edid); spin_lock(&vgdev->display_info_lock); old_edid = output->edid; output->edid = new_edid; - drm_connector_update_edid_property(&output->conn, output->edid); spin_unlock(&vgdev->display_info_lock); kfree(old_edid); -- 2.20.1
2015 Jun 16
0
[PATCH 2/3] drm/virtgpu: initialise fbdev after getting initial display info
...u/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index e5a2c09..ff8de3d 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -171,6 +171,7 @@ struct virtio_gpu_device { wait_queue_head_t resp_wq; /* current display info */ spinlock_t display_info_lock; + bool display_info_pending; struct virtio_gpu_fence_driver fence_drv; diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c index 132405f..782766c 100644 --- a/drivers/gpu/drm/virtio/virtgpu_kms.c +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c @@ -137,9 +137,1...
2018 Sep 13
0
[PATCH 3/3] drm/virtio: add edid support
...if (scanout >= vgdev->num_scanouts) + return; + output = vgdev->outputs + scanout; + + if (drm_edid_is_valid((struct edid *)resp->edid)) { + new_edid = kmalloc(size, GFP_KERNEL); + memcpy(new_edid, resp->edid, size); + } else { + new_edid = NULL; + } + + spin_lock(&vgdev->display_info_lock); + old_edid = output->edid; + output->edid = new_edid; + drm_connector_update_edid_property(&output->conn, output->edid); + spin_unlock(&vgdev->display_info_lock); + + kfree(old_edid); + wake_up(&vgdev->resp_wq); +} + int virtio_gpu_cmd_get_display_info(struct virtio...
2017 May 24
2
[PATCH 02/37] drm: Remove drm_device->virtdev
...); @@ -147,7 +147,7 @@ int virtio_gpu_driver_load(struct drm_device *dev, unsigned long flags) vgdev->ddev = dev; dev->dev_private = vgdev; - vgdev->vdev = dev->virtdev; + vgdev->vdev = dev_to_virtio(dev->dev); vgdev->dev = dev->dev; spin_lock_init(&vgdev->display_info_lock); diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 575b29b47811..c363f2fdff31 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -412,8 +412,6 @@ struct drm_device { struct pci_controller *hose; #endif - struct virtio_device *virtdev; - struct drm_sg_mem *sg; /**< Scatt...
2017 May 24
2
[PATCH 02/37] drm: Remove drm_device->virtdev
...); @@ -147,7 +147,7 @@ int virtio_gpu_driver_load(struct drm_device *dev, unsigned long flags) vgdev->ddev = dev; dev->dev_private = vgdev; - vgdev->vdev = dev->virtdev; + vgdev->vdev = dev_to_virtio(dev->dev); vgdev->dev = dev->dev; spin_lock_init(&vgdev->display_info_lock); diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 575b29b47811..c363f2fdff31 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -412,8 +412,6 @@ struct drm_device { struct pci_controller *hose; #endif - struct virtio_device *virtdev; - struct drm_sg_mem *sg; /**< Scatt...
2020 May 13
0
[PATCH v3 4/4] drm/virtio: Support virtgpu exported resources
...gpu_kms.c > index 4009c2f97d08..5a2aeb6d2f35 100644 > --- a/drivers/gpu/drm/virtio/virtgpu_kms.c > +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c > @@ -134,6 +134,7 @@ int virtio_gpu_init(struct drm_device *dev) > vgdev->dev = dev->dev; > > spin_lock_init(&vgdev->display_info_lock); > + spin_lock_init(&vgdev->resource_export_lock); > ida_init(&vgdev->ctx_id_ida); > ida_init(&vgdev->resource_ida); > init_waitqueue_head(&vgdev->resp_wq); > @@ -162,6 +163,9 @@ int virtio_gpu_init(struct drm_device *dev) > if (virtio_has_feat...
2020 Mar 02
0
[virtio-dev] [PATCH v2 4/4] drm/virtio: Support virtgpu exported resources
...> index 4009c2f97d08..5a2aeb6d2f35 100644 > --- a/drivers/gpu/drm/virtio/virtgpu_kms.c > +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c > @@ -134,6 +134,7 @@ int virtio_gpu_init(struct drm_device *dev) > vgdev->dev = dev->dev; > > spin_lock_init(&vgdev->display_info_lock); > + spin_lock_init(&vgdev->resource_export_lock); > ida_init(&vgdev->ctx_id_ida); > ida_init(&vgdev->resource_ida); > init_waitqueue_head(&vgdev->resp_wq); > @@ -162,6 +163,9 @@ int virtio_gpu_init(struct drm_device *dev) &g...
2018 Sep 26
5
[PATCH 0/4] Improve virtio ID allocation
I noticed you were using IDRs where you could be using the more efficient IDAs, then while fixing that I noticed the lack of error handling, and I decided to follow that up with an efficiency improvement. There's probably a v2 of this to follow because I couldn't figure out how to properly handle one of the error cases ... see the comment embedded in one of the patches. Matthew Wilcox
2015 Mar 24
10
[PATCH] Add virtio gpu driver.
...*vgfbdev; + struct virtio_gpu_output outputs[VIRTIO_GPU_MAX_SCANOUTS]; + uint32_t num_scanouts; + + struct virtio_gpu_queue ctrlq; + struct virtio_gpu_queue cursorq; + + struct idr resource_idr; + spinlock_t resource_idr_lock; + + wait_queue_head_t resp_wq; + /* current display info */ + spinlock_t display_info_lock; + + struct virtio_gpu_fence_driver fence_drv; + + struct idr ctx_id_idr; + spinlock_t ctx_id_idr_lock; + + struct work_struct config_changed_work; +}; + +struct virtio_gpu_fpriv { + uint32_t ctx_id; +}; + +/* virtio_ioctl.c */ +#define DRM_VIRTIO_NUM_IOCTLS 10 +extern struct drm_ioctl_desc virtio_...