Thanks.  It may be a few more days before I can merge this.  But it's on my 
list.

--Mark

On 9/12/22 9:31 PM, Quanyang Wang wrote:
Hi Mark,

I tested this patch at ZCU102 board by following the steps:

1. Build a sato yocto project:
1) repo init -u https://github.com/Xilinx/yocto-manifests.git -b rel-v2022.1
2) repo sync
3) source setupsdk
4) MACHINE=zcu102-zynqmp bitbake core-image-sato

2. Build mainline kernel:
1) git clone
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
2) I attached a patch which fixes the DP driver get clk failure and this
patch is in linux-next git tree and will be merged into mainline soon.
git am 0001-clk-zynqmp-pll-rectify-rate-rounding-in-zynqmp_pll_r.patch
3) Use the config file "config_for_zcu102_X" in attchment to build
kernel and dtb.

Test result:

Before applying "xf86-video-armso: add "zynqmp-dpsub" drmmode interface"
patch:

zcu102-zynqmp:~$ cat /var/log/Xorg.0.log | grep armsoc
[    70.160] (II) LoadModule: "armsoc"
[    70.164] (II) Loading /usr/lib/xorg/modules/drivers/armsoc_drv.so
[    70.165] (II) Module armsoc: vendor="X.Org Foundation"
[    70.200] (WW) Falling back to old probe method for armsoc
[    70.217] (II) UnloadModule: "armsoc"  <== Here is the failure

After applying:
zcu102-zynqmp:~$ cat /var/log/Xorg.0.log | grep armsoc
[    27.573] (II) LoadModule: "armsoc"
[    27.574] (II) Loading /usr/lib/xorg/modules/drivers/armsoc_drv.so
[    27.575] (II) Module armsoc: vendor="X.Org Foundation"
[    27.617] (WW) Falling back to old probe method for armsoc
[    27.767] (II) ARMSOC(0): [DRI2]   DRI driver: armsoc  <== Success

And the Matchbox GUI can be observed at DP monitor.

Thanks,
Quanyang

On 9/13/22 06:12, Mark Hatle wrote:
What configuration are you using with this?

Stock linux-yocto?  Or a different kernel?  Which machine?

I just need a way to build this so I can test that it appears to work.

Thanks!
--Mark

On 9/11/22 11:48 PM, quanyang.wang wrote:
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 \
           "








-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#5055): 
https://lists.yoctoproject.org/g/meta-xilinx/message/5055
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