Skip to content

Commit

Permalink
drm/virtio: Expose allow_p2p capability to user space
Browse files Browse the repository at this point in the history
Signed-off-by: Weifeng Liu <[email protected]>
  • Loading branch information
phreer committed Sep 5, 2024
1 parent 5c59b2c commit 98bf16d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/virtio/virtgpu_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ static int virtio_gpu_getparam_ioctl(struct drm_device *dev, void *data,
case VIRTGPU_PARAM_QUERY_DEV:
value = (strcmp(dev->dev->driver->name, "virtio-pci") == 0) ? 1 : 0;
break;
case VIRTGPU_PARAM_ALLOW_P2P:
value = vgdev->has_allow_p2p ? 1 : 0;
break;
default:
return -EINVAL;
}
Expand Down
1 change: 1 addition & 0 deletions include/uapi/drm/virtgpu_drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ struct drm_virtgpu_execbuffer {
#define VIRTGPU_PARAM_CONTEXT_INIT 6 /* DRM_VIRTGPU_CONTEXT_INIT */
#define VIRTGPU_PARAM_SUPPORTED_CAPSET_IDs 7 /* Bitmask of supported capability set ids */
#define VIRTGPU_PARAM_QUERY_DEV 11 /* Query the virtio device name. */
#define VIRTGPU_PARAM_ALLOW_P2P 12 /* do we accept local memory addresses */

struct drm_virtgpu_getparam {
__u64 param;
Expand Down

0 comments on commit 98bf16d

Please sign in to comment.