From: Quanyang Wang <[email protected]>

Add "zynqmp-dpsub" drmmode_interface so that not only SDK kernel but
also mainline kernel can boot X server successfully.

Signed-off-by: Quanyang Wang <[email protected]>
---
 ...nx-Add-zynqmp-dpsub-drmmode_interfac.patch | 78 +++++++++++++++++++
 .../xorg-driver/xf86-video-armsoc_%.bbappend  |  1 +
 2 files changed, 79 insertions(+)
 create mode 100644 
meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-src-drmmode_xilinx-Add-zynqmp-dpsub-drmmode_interfac.patch

diff --git 
a/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-src-drmmode_xilinx-Add-zynqmp-dpsub-drmmode_interfac.patch
 
b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-src-drmmode_xilinx-Add-zynqmp-dpsub-drmmode_interfac.patch
new file mode 100644
index 00000000..f7fac827
--- /dev/null
+++ 
b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc/0001-src-drmmode_xilinx-Add-zynqmp-dpsub-drmmode_interfac.patch
@@ -0,0 +1,78 @@
+From 9168324f58297b4022947794d15a0b4566e9698e Mon Sep 17 00:00:00 2001
+From: Quanyang Wang <[email protected]>
+Date: Mon, 12 Sep 2022 10:16:35 +0800
+Subject: [PATCH] src: drmmode_xilinx: Add "zynqmp-dpsub" drmmode_interface for
+ mainline drm driver
+
+When booting an X11 graphic system, Xorg will load armsoc_drv.so
+as X.Org Video Driver. In armsoc_drv.so, "xlnx" is the driver_name
+of struct drmmode_interface, and it matches the name used in the
+Xilinx SDK drm driver. Since in mainline the name of zynqmp dpsub
+drm driver has changed to "zynqmp-dpsub", we need to add a new
+drmmode_interface for this, or else Xorg will boot failed and the
+error info as below will be observed in /var/log/Xorg.0.log:
+
+[     9.528] (II) No BusID or DriverName specified - opening /dev/dri/card0
+[     9.528] (II) Got BusID fd4a0000.zynqmp-display
+[     9.541] (II) Opened DRM
+[     9.541] (II)    DeviceName is [/dev/dri/card0]
+[     9.541] (II)    bus_id is [fd4a0000.zynqmp-display]
+[     9.541] (II)    DriverName is [zynqmp-dpsub]
+[     9.541] (II)    version is [1.0.0]
+[     9.554] (II) UnloadModule: "armsoc"
+[     9.554] (EE) Screen(s) found, but none have a usable configuration.
+[     9.554] (EE)
+
+Signed-off-by: Quanyang Wang <[email protected]>
+---
+ src/armsoc_driver.c                 |  1 +
+ src/drmmode_xilinx/drmmode_xilinx.c | 12 ++++++++++++
+ 2 files changed, 13 insertions(+)
+
+diff --git a/src/armsoc_driver.c b/src/armsoc_driver.c
+index a4a1ba3..174be44 100644
+--- a/src/armsoc_driver.c
++++ b/src/armsoc_driver.c
+@@ -738,6 +738,7 @@ static struct drmmode_interface 
*get_drmmode_implementation(int drm_fd)
+               &kirin_interface,
+               &sti_interface,
+               &xilinx_interface,
++              &zynqmp_dpsub_interface,
+       };
+       int i;
+ 
+diff --git a/src/drmmode_xilinx/drmmode_xilinx.c 
b/src/drmmode_xilinx/drmmode_xilinx.c
+index 0ed97ae..5aef1cb 100644
+--- a/src/drmmode_xilinx/drmmode_xilinx.c
++++ b/src/drmmode_xilinx/drmmode_xilinx.c
+@@ -74,3 +74,15 @@ struct drmmode_interface xilinx_interface = {
+       create_custom_gem     /* create_custom_gem */,
+ };
+ 
++struct drmmode_interface zynqmp_dpsub_interface = {
++      "zynqmp-dpsub"        /* name of drm driver */,
++      1                     /* use_page_flip_events */,
++      1                     /* use_early_display */,
++      0                     /* cursor width */,
++      0                     /* cursor_height */,
++      0                     /* cursor padding */,
++      HWCURSOR_API_NONE     /* cursor_api */,
++      NULL                  /* init_plane_for_cursor */,
++      0                     /* vblank_query_supported */,
++      create_custom_gem     /* create_custom_gem */,
++};
+diff --git a/src/drmmode_driver.h b/src/drmmode_driver.h
+index 18245d5..dd05e53 100644
+--- a/src/drmmode_driver.h
++++ b/src/drmmode_driver.h
+@@ -107,6 +107,7 @@ extern struct drmmode_interface pl111_interface;
+ extern struct drmmode_interface kirin_interface;
+ extern struct drmmode_interface sti_interface;
+ extern struct drmmode_interface xilinx_interface;
++extern struct drmmode_interface zynqmp_dpsub_interface;
+ 
+ 
+ #endif
+-- 
+2.36.1
+
diff --git 
a/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc_%.bbappend
 
b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc_%.bbappend
index f7b52f58..fed073e2 100644
--- 
a/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc_%.bbappend
+++ 
b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-graphics/xorg-driver/xf86-video-armsoc_%.bbappend
@@ -2,4 +2,5 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/xf86-video-armsoc:"
 
 SRC_URI:append = " 
file://0001-src-drmmode_xilinx-Add-the-dumb-gem-support-for-Xili.patch \
                    
file://0001-armsoc_driver.c-Bypass-the-exa-layer-to-free-the-roo.patch \
+                   
file://0001-src-drmmode_xilinx-Add-zynqmp-dpsub-drmmode_interfac.patch \
                "
-- 
2.36.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#5052): 
https://lists.yoctoproject.org/g/meta-xilinx/message/5052
Mute This Topic: https://lists.yoctoproject.org/mt/93626964/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-xilinx/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to