summaryrefslogtreecommitdiffstats
path: root/meta-agl-drm-lease/recipes-graphics/weston/weston/0001-backend-drm-Add-method-to-import-DRM-fd.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-drm-lease/recipes-graphics/weston/weston/0001-backend-drm-Add-method-to-import-DRM-fd.patch')
-rw-r--r--meta-agl-drm-lease/recipes-graphics/weston/weston/0001-backend-drm-Add-method-to-import-DRM-fd.patch53
1 files changed, 17 insertions, 36 deletions
diff --git a/meta-agl-drm-lease/recipes-graphics/weston/weston/0001-backend-drm-Add-method-to-import-DRM-fd.patch b/meta-agl-drm-lease/recipes-graphics/weston/weston/0001-backend-drm-Add-method-to-import-DRM-fd.patch
index da3a0c6f..7387be9c 100644
--- a/meta-agl-drm-lease/recipes-graphics/weston/weston/0001-backend-drm-Add-method-to-import-DRM-fd.patch
+++ b/meta-agl-drm-lease/recipes-graphics/weston/weston/0001-backend-drm-Add-method-to-import-DRM-fd.patch
@@ -1,7 +1,7 @@
-From e7d843e3a2af9ed04569f4ec94d3f558ab2aeede Mon Sep 17 00:00:00 2001
+From 9ce172053169bbfd27ef8c18eb50ebac348f5bc2 Mon Sep 17 00:00:00 2001
From: Damian Hobson-Garcia <dhobsong@igel.co.jp>
-Date: Wed, 20 Jan 2021 16:25:39 +0900
-Subject: [PATCH 1/2] backend-drm: Add method to import DRM fd
+Date: Mon, 11 Apr 2022 18:50:45 +0900
+Subject: [PATCH 1/3] backend-drm: Add method to import DRM fd
Allow the compositor to provide a file descriptor for a
DRM device.
@@ -14,26 +14,15 @@ and pass it to the DRM backend for use.
Having the DRM device management in the compositor allows for
integrating a platform specific resource manager without having
to add extra dependencies to the generic libweston code.
+
+%% original patch: 0001-backend-drm-Add-method-to-import-DRM-fd.patch
---
- compositor/main.c | 1 +
include/libweston/backend-drm.h | 7 +++
- libweston/backend-drm/drm.c | 76 ++++++++++++++++++++++++---------
- 3 files changed, 65 insertions(+), 19 deletions(-)
+ libweston/backend-drm/drm.c | 75 ++++++++++++++++++++++++---------
+ 2 files changed, 63 insertions(+), 19 deletions(-)
-diff --git a/compositor/main.c b/compositor/main.c
-index 8eb8a470..7d5373f7 100644
---- a/compositor/main.c
-+++ b/compositor/main.c
-@@ -2510,6 +2510,7 @@ load_drm_backend(struct weston_compositor *c,
- config.base.struct_version = WESTON_DRM_BACKEND_CONFIG_VERSION;
- config.base.struct_size = sizeof(struct weston_drm_backend_config);
- config.configure_device = configure_input_device;
-+ config.device_fd = -1;
-
- wet->heads_changed_listener.notify = drm_heads_changed;
- weston_compositor_add_heads_changed_listener(c,
diff --git a/include/libweston/backend-drm.h b/include/libweston/backend-drm.h
-index f6647e28..a62c8996 100644
+index af2da4a..2c12b17 100644
--- a/include/libweston/backend-drm.h
+++ b/include/libweston/backend-drm.h
@@ -223,6 +223,13 @@ struct weston_drm_backend_config {
@@ -51,7 +40,7 @@ index f6647e28..a62c8996 100644
#ifdef __cplusplus
diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
-index e3169b6e..300c9ff6 100644
+index 4278770..0707db7 100644
--- a/libweston/backend-drm/drm.c
+++ b/libweston/backend-drm/drm.c
@@ -40,6 +40,7 @@
@@ -62,7 +51,7 @@ index e3169b6e..300c9ff6 100644
#include <time.h>
#include <xf86drm.h>
-@@ -2486,29 +2487,22 @@ drm_device_changed(struct weston_compositor *compositor,
+@@ -2670,29 +2671,22 @@ drm_device_changed(struct weston_compositor *compositor,
wl_signal_emit(&compositor->session_signal, compositor);
}
@@ -98,7 +87,7 @@ index e3169b6e..300c9ff6 100644
if (res->count_crtcs <= 0 || res->count_connectors <= 0 ||
res->count_encoders <= 0)
-@@ -2517,7 +2511,7 @@ drm_device_is_kms(struct drm_backend *b, struct udev_device *device)
+@@ -2701,7 +2695,7 @@ drm_device_is_kms(struct drm_backend *b, struct udev_device *device)
if (sysnum)
id = atoi(sysnum);
if (!sysnum || id < 0) {
@@ -107,7 +96,7 @@ index e3169b6e..300c9ff6 100644
goto out_res;
}
-@@ -2527,9 +2521,9 @@ drm_device_is_kms(struct drm_backend *b, struct udev_device *device)
+@@ -2711,9 +2705,9 @@ drm_device_is_kms(struct drm_backend *b, struct udev_device *device)
weston_launcher_close(b->compositor->launcher, b->drm.fd);
free(b->drm.filename);
@@ -119,7 +108,7 @@ index e3169b6e..300c9ff6 100644
b->drm.devnum = devnum;
drmModeFreeResources(res);
-@@ -2538,11 +2532,33 @@ drm_device_is_kms(struct drm_backend *b, struct udev_device *device)
+@@ -2722,11 +2716,33 @@ drm_device_is_kms(struct drm_backend *b, struct udev_device *device)
out_res:
drmModeFreeResources(res);
@@ -155,7 +144,7 @@ index e3169b6e..300c9ff6 100644
/*
* Find primary GPU
* Some systems may have multiple DRM devices attached to a single seat. This
-@@ -2630,6 +2646,25 @@ find_primary_gpu(struct drm_backend *b, const char *seat)
+@@ -2814,6 +2830,25 @@ find_primary_gpu(struct drm_backend *b, const char *seat)
return drm_device;
}
@@ -181,25 +170,17 @@ index e3169b6e..300c9ff6 100644
static struct udev_device *
open_specific_drm_device(struct drm_backend *b, const char *name)
{
-@@ -2854,7 +2889,9 @@ drm_backend_create(struct weston_compositor *compositor,
+@@ -3038,7 +3073,9 @@ drm_backend_create(struct weston_compositor *compositor,
b->session_listener.notify = session_notify;
wl_signal_add(&compositor->session_signal, &b->session_listener);
- if (config->specific_device)
-+ if (config->device_fd >= 0)
++ if (config->device_fd > 0)
+ drm_device = import_drm_device_fd(b, config->device_fd);
+ else if (config->specific_device)
drm_device = open_specific_drm_device(b, config->specific_device);
else
drm_device = find_primary_gpu(b, seat_id);
-@@ -3013,6 +3050,7 @@ static void
- config_init_to_defaults(struct weston_drm_backend_config *config)
- {
- config->use_pixman_shadow = true;
-+ config->device_fd = -1;
- }
-
- WL_EXPORT int
--
-2.25.1
+2.17.1