Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions SPECS/mesa/0001-iris-Add-renderonly-support.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 1562270a76dbfa05a761f75e30089403f5b6d760 Mon Sep 17 00:00:00 2001
From efe403fa0e4198c7b2a041c27c243d9c1685f969 Mon Sep 17 00:00:00 2001
From: Tina Zhang <[email protected]>
Date: Fri, 12 Mar 2021 12:57:41 +0800
Subject: [PATCH 1/6] iris: Add renderonly support
Subject: [PATCH 01/11] iris: Add renderonly support

With this renderonly support, iris can work with other display device to
show display. For example, in virtualization env, a virtio-gpu's display
Expand All @@ -13,29 +13,30 @@ v2: Add iris_resource_create_renderonly() helper function. (Kenneth)
Signed-off-by: Tina Zhang <[email protected]>
Signed-off-by: Mazlan, Hazwan Arif <[email protected]>
---
src/gallium/drivers/iris/iris_resource.c | 56 ++++++++++++++++++-
src/gallium/drivers/iris/iris_resource.c | 57 ++++++++++++++++++-
src/gallium/drivers/iris/iris_resource.h | 1 +
src/gallium/drivers/iris/iris_screen.c | 2 +
src/gallium/drivers/iris/iris_screen.h | 1 +
src/gallium/winsys/iris/drm/iris_drm_public.h | 5 ++
src/gallium/winsys/iris/drm/iris_drm_winsys.c | 20 +++++++
src/gallium/winsys/iris/drm/meson.build | 8 ++-
7 files changed, 91 insertions(+), 2 deletions(-)
7 files changed, 92 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 68f5a43c3e0..2b0a42b451e 100644
index 302afa9ae84..9359d98ec67 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -53,6 +53,8 @@
@@ -55,6 +55,9 @@
#include "intel/dev/intel_debug.h"
#include "isl/isl.h"
#include "drm-uapi/drm_fourcc.h"
#include "drm-uapi/i915_drm.h"
+#include "drm-uapi/i915_drm.h"
+#include "renderonly/renderonly.h"
+#include "util/u_drm.h"

enum modifier_priority {
MODIFIER_PRIORITY_INVALID = 0,
@@ -530,7 +532,12 @@ static void
@@ -527,7 +530,12 @@ static void
iris_resource_destroy(struct pipe_screen *screen,
struct pipe_resource *p_res)
{
Expand All @@ -48,8 +49,8 @@ index 68f5a43c3e0..2b0a42b451e 100644

if (p_res->target == PIPE_BUFFER)
util_range_destroy(&res->valid_buffer_range);
@@ -1199,6 +1206,43 @@ iris_resource_create_for_buffer(struct pipe_screen *pscreen,
return &res->base.b;
@@ -1080,6 +1088,43 @@ iris_resource_image_is_pat_compressible(const struct iris_screen *screen,
return true;
}

+static struct pipe_resource *
Expand Down Expand Up @@ -92,7 +93,7 @@ index 68f5a43c3e0..2b0a42b451e 100644
static struct pipe_resource *
iris_resource_create_for_image(struct pipe_screen *pscreen,
const struct pipe_resource *templ,
@@ -1208,8 +1252,14 @@ iris_resource_create_for_image(struct pipe_screen *pscreen,
@@ -1089,8 +1134,14 @@ iris_resource_create_for_image(struct pipe_screen *pscreen,
{
struct iris_screen *screen = (struct iris_screen *)pscreen;
const struct intel_device_info *devinfo = screen->devinfo;
Expand All @@ -108,7 +109,7 @@ index 68f5a43c3e0..2b0a42b451e 100644
if (!res)
return NULL;

@@ -1925,6 +1975,10 @@ iris_resource_get_handle(struct pipe_screen *pscreen,
@@ -1893,6 +1944,10 @@ iris_resource_get_handle(struct pipe_screen *pscreen,
case WINSYS_HANDLE_TYPE_KMS: {
iris_gem_set_tiling(bo, &res->surf);

Expand All @@ -120,7 +121,7 @@ index 68f5a43c3e0..2b0a42b451e 100644
* we export a GEM handle we must make sure it is valid in the DRM file
* descriptor the caller is using (this is the FD given at screen
diff --git a/src/gallium/drivers/iris/iris_resource.h b/src/gallium/drivers/iris/iris_resource.h
index ffb50af9796..baa77c36518 100644
index 4b946242636..7b1fa8366f2 100644
--- a/src/gallium/drivers/iris/iris_resource.h
+++ b/src/gallium/drivers/iris/iris_resource.h
@@ -55,6 +55,7 @@ struct iris_format_info {
Expand All @@ -132,7 +133,7 @@ index ffb50af9796..baa77c36518 100644
/**
* The ISL surface layout information for this resource.
diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c
index 74094b016ce..70838aa8a01 100644
index 29c6ead4acb..514a2239026 100644
--- a/src/gallium/drivers/iris/iris_screen.c
+++ b/src/gallium/drivers/iris/iris_screen.c
@@ -59,6 +59,7 @@
Expand All @@ -143,7 +144,7 @@ index 74094b016ce..70838aa8a01 100644

#define genX_call(devinfo, func, ...) \
switch ((devinfo)->verx10) { \
@@ -672,6 +673,7 @@ iris_screen_destroy(struct iris_screen *screen)
@@ -596,6 +597,7 @@ iris_screen_destroy(struct iris_screen *screen)
iris_bufmgr_unref(screen->bufmgr);
disk_cache_destroy(screen->disk_cache);
close(screen->winsys_fd);
Expand All @@ -152,10 +153,10 @@ index 74094b016ce..70838aa8a01 100644
}

diff --git a/src/gallium/drivers/iris/iris_screen.h b/src/gallium/drivers/iris/iris_screen.h
index 1b22cb12a18..7bc0b996722 100644
index d8e9edf45eb..6d23ca80748 100644
--- a/src/gallium/drivers/iris/iris_screen.h
+++ b/src/gallium/drivers/iris/iris_screen.h
@@ -156,6 +156,7 @@ struct iris_address {
@@ -171,6 +171,7 @@ struct iris_address {

struct iris_screen {
struct pipe_screen base;
Expand Down Expand Up @@ -218,12 +219,12 @@ index 15095e2d3fa..b414b64ef22 100644
+ return &pscreen->base;
+}
diff --git a/src/gallium/winsys/iris/drm/meson.build b/src/gallium/winsys/iris/drm/meson.build
index 3dcdc4a455e..cc9ea810756 100644
index 1ed56b2e8cd..eeac906e6d3 100644
--- a/src/gallium/winsys/iris/drm/meson.build
+++ b/src/gallium/winsys/iris/drm/meson.build
@@ -18,12 +18,18 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
@@ -1,13 +1,19 @@
# Copyright © 2017 Intel Corporation
# SPDX-License-Identifier: MIT

+iris_drm_winsys_c_args = []
+if with_gallium_kmsro
Expand All @@ -240,6 +241,7 @@ index 3dcdc4a455e..cc9ea810756 100644
],
+ c_args : [iris_drm_winsys_c_args],
gnu_symbol_visibility : 'hidden',
dependencies: idep_mesautil,
)
--
2.34.1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From a61053e91940c1cf1256763681cdc76f269e305e Mon Sep 17 00:00:00 2001
From: Dave Airlie <[email protected]>
Date: Tue, 18 Feb 2025 17:00:42 +1000
Subject: [PATCH] vulkan/wsi/x11: fix use of uninitialised xfixes region.

If you are in the sw + no mit-shm support, we don't create the xfixes region,
so don't try and use it in the same scenario.

We are seeing some gtk4 apps crash with BadRegion reports due to this.

Fixes: bbdf7e45b15f ("wsi/x11: Hook up KHR_incremental_present")
---
src/vulkan/wsi/wsi_common_x11.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 8c364cd94dd..e8ebe4fb041 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -1804,13 +1804,17 @@ x11_queue_present(struct wsi_swapchain *anv_chain,
{
struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain;
xcb_xfixes_region_t update_area = 0;
+ bool set_damage = damage ? true : false;

/* If the swapchain is in an error state, don't go any further. */
VkResult status = x11_swapchain_read_status_atomic(chain);
if (status < 0)
return status;

- if (damage && damage->pRectangles && damage->rectangleCount > 0 &&
+ if (chain->base.wsi->sw && !chain->has_mit_shm)
+ set_damage = false;
+
+ if (set_damage && damage->pRectangles && damage->rectangleCount > 0 &&
damage->rectangleCount <= MAX_DAMAGE_RECTS) {
xcb_rectangle_t *rects = chain->images[image_index].rects;

--
2.48.1
36 changes: 18 additions & 18 deletions SPECS/mesa/0002-kmsro-Add-iris-renderonly-support.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From b4b37f6d7d7460684576a53f53be61fe7b307ca1 Mon Sep 17 00:00:00 2001
From 0426e1bbb3089e0728fa4d432463dacabaf037cf Mon Sep 17 00:00:00 2001
From: Dongwon Kim <[email protected]>
Date: Fri, 19 Jan 2024 12:32:36 -0800
Subject: [PATCH 3/3] kmsro: Add iris renderonly support
Subject: [PATCH 02/11] kmsro: Add iris renderonly support

Enable using iris for KMS renderonly.

Expand All @@ -23,10 +23,10 @@ Signed-off-by: Dongwon Kim <[email protected]>
8 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index 6d10219f067..21da93d3387 100644
index 1bd2bbc0a64..67243458b54 100644
--- a/meson.build
+++ b/meson.build
@@ -205,6 +205,7 @@ with_gallium_kmsro = system_has_kms_drm and [
@@ -222,6 +222,7 @@ with_gallium_kmsro = system_has_kms_drm and [
with_gallium_panfrost,
with_gallium_v3d,
with_gallium_vc4,
Expand All @@ -35,10 +35,10 @@ index 6d10219f067..21da93d3387 100644

_vulkan_drivers = get_option('vulkan-drivers')
diff --git a/src/gallium/auxiliary/pipe-loader/meson.build b/src/gallium/auxiliary/pipe-loader/meson.build
index 7927515cf98..a1d9a51880f 100644
index c828cab6169..98821c28050 100644
--- a/src/gallium/auxiliary/pipe-loader/meson.build
+++ b/src/gallium/auxiliary/pipe-loader/meson.build
@@ -56,6 +56,9 @@ endif
@@ -39,6 +39,9 @@ endif
if with_gallium_asahi
renderonly_drivers_c_args += '-DGALLIUM_ASAHI'
endif
Expand All @@ -49,10 +49,10 @@ index 7927515cf98..a1d9a51880f 100644
libpipe_loader_static = static_library(
'pipe_loader_static',
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index 055c637199d..e978c65cddb 100644
index 985ace997bd..9df6c0ce31b 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -295,6 +295,9 @@ pipe_loader_get_compatible_render_capable_device_fd(int kms_only_fd)
@@ -331,6 +331,9 @@ pipe_loader_get_compatible_render_capable_device_fd(int kms_only_fd)
#endif
#if defined GALLIUM_VC4
"vc4",
Expand All @@ -62,7 +62,7 @@ index 055c637199d..e978c65cddb 100644
#endif
};

@@ -303,10 +306,12 @@ pipe_loader_get_compatible_render_capable_device_fd(int kms_only_fd)
@@ -339,10 +342,12 @@ pipe_loader_get_compatible_render_capable_device_fd(int kms_only_fd)
is_platform_device = (dev->type == PIPE_LOADER_DEVICE_PLATFORM);
pipe_loader_release(&dev, 1);

Expand All @@ -76,20 +76,20 @@ index 055c637199d..e978c65cddb 100644
/* For platform display-only devices, we try to find a render-capable device
* on the platform bus and that should be compatible with the display-only
diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h b/src/gallium/auxiliary/target-helpers/drm_helper.h
index be44b8f71df..106bac7f7e1 100644
index 3ddab30af49..f92a49e079b 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper.h
@@ -68,6 +68,7 @@ const struct drm_driver_descriptor descriptor_name = { \
@@ -69,6 +69,7 @@ const struct drm_driver_descriptor descriptor_name = { \
#undef GALLIUM_PANFROST
#undef GALLIUM_LIMA
#undef GALLIUM_ASAHI
+#undef GALLIUM_IRIS
#endif

#ifdef GALLIUM_I915
@@ -454,6 +455,9 @@ const driOptionDescription kmsro_driconf[] = {
#ifdef GALLIUM_FREEDRENO
#include "freedreno/driinfo_freedreno.h"
@@ -447,6 +448,9 @@ const driOptionDescription kmsro_driconf[] = {
#ifdef GALLIUM_PANFROST
#include "panfrost/driinfo_panfrost.h"
#endif
+#ifdef GALLIUM_IRIS
+ #include "iris/driinfo_iris.h"
Expand Down Expand Up @@ -130,7 +130,7 @@ index b414b64ef22..bf6c5577c78 100644
return NULL;

diff --git a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
index 3d14bce1ce7..87d39e08a95 100644
index 259e876dc8b..46916e86722 100644
--- a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
+++ b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
@@ -33,6 +33,7 @@
Expand All @@ -141,7 +141,7 @@ index 3d14bce1ce7..87d39e08a95 100644
#include "xf86drm.h"

#include "pipe/p_screen.h"
@@ -119,6 +120,11 @@ struct pipe_screen *kmsro_drm_screen_create(int kms_fd,
@@ -120,6 +121,11 @@ struct pipe_screen *kmsro_drm_screen_create(int kms_fd,
*/
ro->create_for_resource = renderonly_create_gpu_import_for_resource;
screen = vc4_drm_screen_create_renderonly(ro->gpu_fd, ro, config);
Expand All @@ -154,10 +154,10 @@ index 3d14bce1ce7..87d39e08a95 100644
}

diff --git a/src/loader/loader.c b/src/loader/loader.c
index 4b8f532fe74..e1c0f83b846 100644
index e8a9b76913a..0164acdd776 100644
--- a/src/loader/loader.c
+++ b/src/loader/loader.c
@@ -154,8 +154,8 @@ loader_open_render_node_platform_device(const char * const drivers[],
@@ -186,8 +186,8 @@ loader_open_render_node_platform_device(const char * const drivers[],
for (i = 0; i < num_devices; i++) {
device = devices[i];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
From b05b95d83dc737b59bf9d20f04041d0270740b90 Mon Sep 17 00:00:00 2001
From 8282ccb489d5d2172574b9f59b720c480024dfd7 Mon Sep 17 00:00:00 2001
From: tchew6 <[email protected]>
Date: Thu, 24 Jun 2021 13:20:53 +0800
Subject: [PATCH 3/6] iris/kmsro: use ro device to allocate scanout for render
Subject: [PATCH 03/11] iris/kmsro: use ro device to allocate scanout for
render

Signed-off-by: Chew, Tong Liang <[email protected]>
Signed-off-by: Mazlan, Hazwan Arif <[email protected]>
Expand All @@ -10,10 +11,10 @@ Signed-off-by: Mazlan, Hazwan Arif <[email protected]>
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 2b0a42b451e..63245f4014a 100644
index 9359d98ec67..0f1aef8678b 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -1252,11 +1252,14 @@ iris_resource_create_for_image(struct pipe_screen *pscreen,
@@ -1134,11 +1134,14 @@ iris_resource_create_for_image(struct pipe_screen *pscreen,
{
struct iris_screen *screen = (struct iris_screen *)pscreen;
const struct intel_device_info *devinfo = screen->devinfo;
Expand All @@ -29,7 +30,7 @@ index 2b0a42b451e..63245f4014a 100644
}

struct iris_resource *res = iris_alloc_resource(pscreen, templ);
@@ -1975,8 +1978,7 @@ iris_resource_get_handle(struct pipe_screen *pscreen,
@@ -1944,8 +1947,7 @@ iris_resource_get_handle(struct pipe_screen *pscreen,
case WINSYS_HANDLE_TYPE_KMS: {
iris_gem_set_tiling(bo, &res->surf);

Expand Down
Loading
Loading