[mesa3d] Sync all patch files with DDK 1.17.

This commit is contained in:
Windsome Zeng
2022-08-16 17:38:05 +08:00
parent 6bfcc5fdc6
commit fe38db9384
70 changed files with 5794 additions and 6452 deletions
+100 -33
View File
@@ -1,22 +1,23 @@
From 7b733f4e2b20614d9f367186810c4fcac4aa820c Mon Sep 17 00:00:00 2001
From 0751612b949f1c90338a14453ff7fa4be8bfd016 Mon Sep 17 00:00:00 2001
From: Brendan King <Brendan.King@imgtec.com>
Date: Tue, 28 Nov 2017 16:27:38 +0000
Subject: [PATCH 25/50] gbm: add gbm_bo_blit
Subject: [PATCH 24/67] gbm: add gbm_bo_blit
For the GBM DRI backend, gbm_bo_blit is a wrapper around blitImage in
the DRI Image extension.
---
src/gbm/backends/dri/gbm_dri.c | 32 ++++++++++++++++++++++++++++++++
src/gbm/main/gbm.c | 28 ++++++++++++++++++++++++++++
src/gbm/backends/dri/gbm_dri.c | 33 +++++++++++++++++++++++++++++++++
src/gbm/main/gbm.c | 31 +++++++++++++++++++++++++++++++
src/gbm/main/gbm.h | 21 +++++++++++++++++++++
src/gbm/main/gbmint.h | 4 ++++
4 files changed, 85 insertions(+)
src/gbm/main/gbm_abi_check.c | 20 +++++++++++++++++++-
src/gbm/main/gbm_backend_abi.h | 10 +++++++++-
5 files changed, 113 insertions(+), 2 deletions(-)
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index b5634741554..ca865f4df9c 100644
index 96fa9217255..bd8a80cdecf 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -1334,6 +1334,37 @@ gbm_dri_surface_destroy(struct gbm_surface *_surf)
@@ -1355,6 +1355,37 @@ gbm_dri_surface_destroy(struct gbm_surface *_surf)
free(surf);
}
@@ -54,23 +55,23 @@ index b5634741554..ca865f4df9c 100644
static void
dri_destroy(struct gbm_device *gbm)
{
@@ -1383,6 +1414,7 @@ dri_device_create(int fd)
dri->base.destroy = dri_destroy;
dri->base.surface_create = gbm_dri_surface_create;
dri->base.surface_destroy = gbm_dri_surface_destroy;
+ dri->base.bo_blit = gbm_dri_bo_blit;
@@ -1416,6 +1447,8 @@ dri_device_create(int fd, uint32_t gbm_backend_version)
dri->base.name = "drm";
dri->base.v0.name = "drm";
+ dri->base.v1.bo_blit = gbm_dri_bo_blit;
+
dri->visual_table = gbm_dri_visuals_table;
dri->num_visuals = ARRAY_SIZE(gbm_dri_visuals_table);
diff --git a/src/gbm/main/gbm.c b/src/gbm/main/gbm.c
index 954b3c35b0d..78de34286bd 100644
index d81931a7483..e2351d34ad8 100644
--- a/src/gbm/main/gbm.c
+++ b/src/gbm/main/gbm.c
@@ -741,3 +741,31 @@ gbm_format_get_name(uint32_t gbm_format, struct gbm_format_name_desc *desc)
@@ -758,6 +758,37 @@ gbm_format_get_name(uint32_t gbm_format, struct gbm_format_name_desc *desc)
return desc->name;
}
+
+/**
+ * Blit from one buffer object to another
+ *
@@ -93,13 +94,20 @@ index 954b3c35b0d..78de34286bd 100644
+ int src_x0, int src_y0, int src_width, int src_height,
+ enum gbm_blit_flags flags)
+{
+ return dst_bo->gbm->bo_blit(dst_bo, src_bo,
+ dst_x0, dst_y0, dst_width, dst_height,
+ src_x0, src_y0, src_width, src_height,
+ flags);
+ if (dst_bo->gbm->v0.backend_version >= 1)
+ return dst_bo->gbm->v1.bo_blit(dst_bo, src_bo,
+ dst_x0, dst_y0, dst_width, dst_height,
+ src_x0, src_y0, src_width, src_height,
+ flags);
+ else
+ return 0;
+}
+
/**
* A global table of functions and global variables defined in the core GBM
* code that need to be accessed directly by GBM backends.
diff --git a/src/gbm/main/gbm.h b/src/gbm/main/gbm.h
index 5801cd526a0..e754edd5654 100644
index 3a0fe73faae..7c82cd661a3 100644
--- a/src/gbm/main/gbm.h
+++ b/src/gbm/main/gbm.h
@@ -246,6 +246,21 @@ enum gbm_bo_flags {
@@ -124,7 +132,7 @@ index 5801cd526a0..e754edd5654 100644
int
gbm_device_get_fd(struct gbm_device *gbm);
@@ -422,6 +437,12 @@ gbm_surface_destroy(struct gbm_surface *surface);
@@ -425,6 +440,12 @@ gbm_surface_destroy(struct gbm_surface *surface);
char *
gbm_format_get_name(uint32_t gbm_format, struct gbm_format_name_desc *desc);
@@ -137,21 +145,80 @@ index 5801cd526a0..e754edd5654 100644
#ifdef __cplusplus
}
#endif
diff --git a/src/gbm/main/gbmint.h b/src/gbm/main/gbmint.h
index 192577431e2..fb95954ab32 100644
--- a/src/gbm/main/gbmint.h
+++ b/src/gbm/main/gbmint.h
@@ -98,6 +98,10 @@ struct gbm_device {
struct gbm_bo *bo);
int (*surface_has_free_buffers)(struct gbm_surface *surface);
void (*surface_destroy)(struct gbm_surface *surface);
diff --git a/src/gbm/main/gbm_abi_check.c b/src/gbm/main/gbm_abi_check.c
index f1137be7baf..02ce23b129e 100644
--- a/src/gbm/main/gbm_abi_check.c
+++ b/src/gbm/main/gbm_abi_check.c
@@ -101,6 +101,21 @@ struct gbm_device_abi0 {
struct gbm_device_v0_abi0 v0;
};
+#define GBM_BACKEND_ABI_VERSION_abi1 1
+struct gbm_device_v1_abi1 {
+ int (*bo_blit)(struct gbm_bo *dst_bo, struct gbm_bo *src_bo,
+ int dst_x0, int dst_y0, int dst_width, int dst_height,
+ int src_x0, int src_y0, int src_width, int src_height,
+ enum gbm_blit_flags flags);
+};
+
+struct gbm_device_abi1 {
+ /* Hack to make a gbm_device detectable by its first element. */
+ struct gbm_device *(*dummy)(int);
+ struct gbm_device_v0_abi0 v0;
+ struct gbm_device_v1_abi1 v1;
+};
+
/**
* GBM buffer object interface corresponding to GBM_BACKEND_ABI_VERSION = 0
*
@@ -359,8 +374,11 @@ int main(int argc, char **argv)
CHECK_MEMBER_CURRENT(gbm_device_v0, _abi0, surface_has_free_buffers);
CHECK_MEMBER_CURRENT(gbm_device_v0, _abi0, surface_destroy);
+ CHECK_MEMBER_CURRENT(gbm_device_v1, _abi1, bo_blit);
+
/* Size of ABI-versioned substructures verified by above member checks */
- CHECK_SIZE_CURRENT (gbm_device, _abi0);
+ CHECK_SIZE (gbm_device, _abi0, _abi1);
+ CHECK_SIZE_CURRENT (gbm_device, _abi1);
/* Check current gbm_bo ABI against gbm_bo_abi0*/
diff --git a/src/gbm/main/gbm_backend_abi.h b/src/gbm/main/gbm_backend_abi.h
index 962ee74f003..3abf29faa92 100644
--- a/src/gbm/main/gbm_backend_abi.h
+++ b/src/gbm/main/gbm_backend_abi.h
@@ -72,7 +72,7 @@ struct gbm_backend_desc;
* Core ABI version: 4
* ABI version of a buffer object created by a device from the backend: 4
*/
-#define GBM_BACKEND_ABI_VERSION 0
+#define GBM_BACKEND_ABI_VERSION 1
/**
* GBM device interface corresponding to GBM_BACKEND_ABI_VERSION = 0
@@ -149,6 +149,13 @@ struct gbm_device_v0 {
void (*surface_destroy)(struct gbm_surface *surface);
};
+struct gbm_device_v1 {
+ int (*bo_blit)(struct gbm_bo *dst_bo, struct gbm_bo *src_bo,
+ int dst_x0, int dst_y0, int dst_width, int dst_height,
+ int src_x0, int src_y0, int src_width, int src_height,
+ enum gbm_blit_flags flags);
+};
+
/**
* The device used for the memory allocation.
*
@@ -161,6 +168,7 @@ struct gbm_device {
/* Hack to make a gbm_device detectable by its first element. */
struct gbm_device *(*dummy)(int);
struct gbm_device_v0 v0;
+ struct gbm_device_v1 v1;
};
/**
--
2.17.1
2.25.1