mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
ui/egl: use DRM_FORMAT_MOD_INVALID as default modifier
0 is used as DRM_FORMAT_MOD_LINEAR already. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Message-ID: <20250327025848.46962-4-yuq825@gmail.com>
This commit is contained in:
parent
806c861dc6
commit
ac70568902
3 changed files with 7 additions and 3 deletions
|
@ -18,6 +18,7 @@
|
||||||
#include "chardev/char-fe.h"
|
#include "chardev/char-fe.h"
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "migration/blocker.h"
|
#include "migration/blocker.h"
|
||||||
|
#include "standard-headers/drm/drm_fourcc.h"
|
||||||
|
|
||||||
typedef enum VhostUserGpuRequest {
|
typedef enum VhostUserGpuRequest {
|
||||||
VHOST_USER_GPU_NONE = 0,
|
VHOST_USER_GPU_NONE = 0,
|
||||||
|
@ -251,7 +252,7 @@ vhost_user_gpu_handle_display(VhostUserGPU *g, VhostUserGpuMsg *msg)
|
||||||
int fd = qemu_chr_fe_get_msgfd(&g->vhost_chr);
|
int fd = qemu_chr_fe_get_msgfd(&g->vhost_chr);
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
uint32_t stride = m->fd_stride;
|
uint32_t stride = m->fd_stride;
|
||||||
uint64_t modifier = 0;
|
uint64_t modifier = DRM_FORMAT_MOD_INVALID;
|
||||||
QemuDmaBuf *dmabuf;
|
QemuDmaBuf *dmabuf;
|
||||||
|
|
||||||
if (m->scanout_id >= g->parent_obj.conf.max_outputs) {
|
if (m->scanout_id >= g->parent_obj.conf.max_outputs) {
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <linux/memfd.h>
|
#include <linux/memfd.h>
|
||||||
#include "qemu/memfd.h"
|
#include "qemu/memfd.h"
|
||||||
#include "standard-headers/linux/udmabuf.h"
|
#include "standard-headers/linux/udmabuf.h"
|
||||||
|
#include "standard-headers/drm/drm_fourcc.h"
|
||||||
|
|
||||||
static void virtio_gpu_create_udmabuf(struct virtio_gpu_simple_resource *res)
|
static void virtio_gpu_create_udmabuf(struct virtio_gpu_simple_resource *res)
|
||||||
{
|
{
|
||||||
|
@ -187,7 +188,8 @@ static VGPUDMABuf
|
||||||
&offset, &fb->stride,
|
&offset, &fb->stride,
|
||||||
r->x, r->y, fb->width, fb->height,
|
r->x, r->y, fb->width, fb->height,
|
||||||
qemu_pixman_to_drm_format(fb->format),
|
qemu_pixman_to_drm_format(fb->format),
|
||||||
0, &res->dmabuf_fd, 1, true, false);
|
DRM_FORMAT_MOD_INVALID, &res->dmabuf_fd,
|
||||||
|
1, true, false);
|
||||||
dmabuf->scanout_id = scanout_id;
|
dmabuf->scanout_id = scanout_id;
|
||||||
QTAILQ_INSERT_HEAD(&g->dmabuf.bufs, dmabuf, next);
|
QTAILQ_INSERT_HEAD(&g->dmabuf.bufs, dmabuf, next);
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "system/system.h"
|
#include "system/system.h"
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
#include "standard-headers/drm/drm_fourcc.h"
|
||||||
|
|
||||||
EGLDisplay *qemu_egl_display;
|
EGLDisplay *qemu_egl_display;
|
||||||
EGLConfig qemu_egl_config;
|
EGLConfig qemu_egl_config;
|
||||||
|
@ -333,7 +334,7 @@ void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf)
|
||||||
attrs[i++] = qemu_dmabuf_get_strides(dmabuf, NULL)[0];
|
attrs[i++] = qemu_dmabuf_get_strides(dmabuf, NULL)[0];
|
||||||
attrs[i++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT;
|
attrs[i++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT;
|
||||||
attrs[i++] = 0;
|
attrs[i++] = 0;
|
||||||
if (modifier) {
|
if (modifier != DRM_FORMAT_MOD_INVALID) {
|
||||||
attrs[i++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT;
|
attrs[i++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT;
|
||||||
attrs[i++] = (modifier >> 0) & 0xffffffff;
|
attrs[i++] = (modifier >> 0) & 0xffffffff;
|
||||||
attrs[i++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT;
|
attrs[i++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue