mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
LibC: Add ioctls for VirGL
This commit is contained in:
parent
04849c9561
commit
0e57f80460
2 changed files with 44 additions and 0 deletions
38
Kernel/API/VirGL.h
Normal file
38
Kernel/API/VirGL.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Sahan Fernando <sahan.h.fernando@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Types.h>
|
||||
|
||||
struct VirGL3DResourceSpec {
|
||||
u32 target;
|
||||
u32 format;
|
||||
u32 bind;
|
||||
u32 width;
|
||||
u32 height;
|
||||
u32 depth;
|
||||
u32 array_size;
|
||||
u32 last_level;
|
||||
u32 nr_samples;
|
||||
u32 flags;
|
||||
u32 created_resource_id;
|
||||
};
|
||||
|
||||
struct VirGLCommandBuffer {
|
||||
const u32* data;
|
||||
u32 num_elems;
|
||||
};
|
||||
|
||||
#define VIRGL_DATA_DIR_GUEST_TO_HOST 1
|
||||
#define VIRGL_DATA_DIR_HOST_TO_GUEST 2
|
||||
|
||||
struct VirGLTransferDescriptor {
|
||||
void* data;
|
||||
size_t offset_in_region;
|
||||
size_t num_bytes;
|
||||
int direction;
|
||||
};
|
|
@ -125,6 +125,9 @@ enum IOCtlNumber {
|
|||
SOUNDCARD_IOCTL_GET_SAMPLE_RATE,
|
||||
STORAGE_DEVICE_GET_SIZE,
|
||||
STORAGE_DEVICE_GET_BLOCK_SIZE,
|
||||
VIRGL_IOCTL_CREATE_RESOURCE,
|
||||
VIRGL_IOCTL_SUBMIT_CMD,
|
||||
VIRGL_IOCTL_TRANSFER_DATA,
|
||||
};
|
||||
|
||||
#define TIOCGPGRP TIOCGPGRP
|
||||
|
@ -172,3 +175,6 @@ enum IOCtlNumber {
|
|||
#define SOUNDCARD_IOCTL_GET_SAMPLE_RATE SOUNDCARD_IOCTL_GET_SAMPLE_RATE
|
||||
#define STORAGE_DEVICE_GET_SIZE STORAGE_DEVICE_GET_SIZE
|
||||
#define STORAGE_DEVICE_GET_BLOCK_SIZE STORAGE_DEVICE_GET_BLOCK_SIZE
|
||||
#define VIRGL_IOCTL_CREATE_RESOURCE VIRGL_IOCTL_CREATE_RESOURCE
|
||||
#define VIRGL_IOCTL_SUBMIT_CMD VIRGL_IOCTL_SUBMIT_CMD
|
||||
#define VIRGL_IOCTL_TRANSFER_DATA VIRGL_IOCTL_TRANSFER_DATA
|
||||
|
|
Loading…
Add table
Reference in a new issue