Skip to content

Commit

Permalink
Use ivshmem-backed virtio-GPU as KMS driver in the case of QNX
Browse files Browse the repository at this point in the history
The QNX scenario uses ivshmem-backed virtio-GPU for display, a special
use case for us. We distinguish this scenario by checking whether the
ivshmem virtio-GPU is the only virtio-GPU on the system.

Tracked-On: OAM-127906
Signed-off-by: Weifeng Liu <[email protected]>
  • Loading branch information
phreer committed Nov 29, 2024
1 parent 30cbaec commit 52ac6bd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cros_gralloc/cros_gralloc_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -958,9 +958,17 @@ int cros_gralloc_driver::select_render_driver(uint64_t gpu_grp_type)

int cros_gralloc_driver::select_kms_driver(uint64_t gpu_grp_type)
{
// virtio-GPU without blob cannot import external buffers.
if (gpu_grp_type & GPU_GRP_TYPE_HAS_VIRTIO_GPU_NO_BLOB_BIT) {
return GPU_GRP_TYPE_VIRTIO_GPU_NO_BLOB_IDX;
}
// QNX case: virtio-GPU is ivshmem backed device and cannot import external buffers.
// Screen cast also uses ivshmem virtio-GPU but we have virtio-GPU supporting blob.
if ((gpu_grp_type & GPU_GRP_TYPE_HAS_VIRTIO_GPU_IVSHMEM_BIT) &&
!(gpu_grp_type & GPU_GRP_TYPE_HAS_VIRTIO_GPU_BLOB_BIT) &&
!(gpu_grp_type & GPU_GRP_TYPE_HAS_VIRTIO_GPU_BLOB_P2P_BIT)) {
return GPU_GRP_TYPE_VIRTIO_GPU_IVSHMEM_IDX;
}
if (gpu_grp_type & GPU_GRP_TYPE_HAS_INTEL_DGPU_BIT) {
return GPU_GRP_TYPE_INTEL_DGPU_IDX;
}
Expand Down

0 comments on commit 52ac6bd

Please sign in to comment.