xilinx_drm and atomic modesetting
Hi guys,
Note: I was a total DRM newbie at the beginning of this exercise. Now I would say I'm just newbie. ;)
I am trying to implement our lvds panel using xilinx_drm on zynqmp. We are composing our pipeline starting with the xilinx-vdma, then a few logic parts from the ALI3 on zedboard ref design. The only configurable bits in this pipeline are the vdma registers at one end, then an enable GPIO and PWM going to the panel itself. The rest (resolution, etc.) are hard-coded at synthesis time.
This makes things simpler, in theory.
I opted to use the lvds-encoder.c (found upstream) which is actually a drm_bridge (!??), and the panel-lvds.c(also upstream) driver which take resolution and timings from dts and create a drm_panel. All I was missing is an encoder (xilinx_drm_encoder would not do). I created a somewhat dummy encoder which binds the crtc to the bridge just by being present. It is discovered by xilinx_drm_drv by the component subsys using the endpoints in dts.
From what I now understand, there are two "worlds" in the DRM/KMS framework, legacy and atomic. From what I gather, xilinx_drm stands on the legacy side. Whereas the drm_bridge and drm_panel are more on the atomic side.
I believe this is what's causing a few OOPS and exceptions here and there that I had to "patch" by adding "if" statements for null objects. For example, one is struct drm_connector_state missing on the crtc. This is used by atomic helpers invoked by the drm_bridge (if I remember correctly).
In https://github.com/Xilinx/linux-xlnx/commit/d5733539adba1c509cb82bd3d4d418a3dbfbfd68 there is suggestion that xilinx_drm be converted to atomic modesetting.
Is this work started? I would like to contribute by testing and submitting patches. Maybe a topic branch on github in linux-xlnx would help us out, and help you out as well to get the driver more polished sooner.
Cheers!
/jfd
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Jean-Francois,
As you noted, the Xilinx DRM driver in Xilinx tree is missing many mainline features including the atomic mode setting and needs some restructuring. Please feel free to send patches to Xilinx git-dev, but note that we are also developing / cleaning up the driver internally at Xilinx to upstream in near feature. While doing that, the code base may change due to heavy cleanup.
Thanks,
-hyun
Quoted 45 lines
-----Original Message-----
From: Jean-Francois Dagenais [mailto:[email protected]]
Sent: Tuesday, June 27, 2017 6:21 AM
To: Hyun Kwon <[email protected]>; Michal Simek <[email protected]>
Cc: Soren Brinkmann <[email protected]>; git <[email protected]>; [email protected]; [email protected]
Subject:xilinx_drmand atomic modesettingHi guys,
Note: I was a total DRM newbie at the beginning of this exercise. Now I would say I'm just newbie. ;)
I am trying to implement our lvds panel using
xilinx_drmon zynqmp. We are composing our pipeline starting with the xilinx-vdma, then a few logic parts from the ALI3 on zedboard ref design. The only configurable bits in this pipeline are the vdma registers at one end, then an enable GPIO and PWM going to the panel itself. The rest (resolution, etc.) are hard-coded at synthesis time.This makes things simpler, in theory.
I opted to use the
lvds-encoder.c(found upstream) which is actually adrm_bridge(!??), and the panel-lvds.c(also upstream) driver which take resolution and timings from dts and create adrm_panel. All I was missing is an encoder (xilinx_drm_encoderwould not do). I created a somewhat dummy encoder which binds the crtc to the bridge just by being present. It is discovered byxilinx_drm_drvby the component subsys using the endpoints in dts.From what I now understand, there are two "worlds" in the DRM/KMS framework, legacy and atomic. From what I gather,
xilinx_drmstands on the legacy side. Whereas thedrm_bridgeanddrm_panelare more on the atomic side.I believe this is what's causing a few OOPS and exceptions here and there that I had to "patch" by adding "if" statements for null objects. For example, one is struct
drm_connector_statemissing on the crtc. This is used by atomic helpers invoked by thedrm_bridge(if I remember correctly).In https://github.com/Xilinx/linux-
xlnx/commit/d5733539adba1c509cb82bd3d4d418a3dbfbfd68 there is suggestion thatxilinx_drmbe converted to atomic modesetting.
Quoted 6 lines
Is this work started? I would like to contribute by testing and submitting patches. Maybe a topic branch on github in linux-xlnx would help us out, and help you out as well to get the driver more polished sooner.
Cheers!
/jfd
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Hyun,
Quoted 4 lines · Hyun Kwon
As you noted, the Xilinx DRM driver in Xilinx tree is missing many mainline features including the atomic mode setting and needs some restructuring. Please feel free to send patches to Xilinx git-dev, but note that we are also developing / cleaning up the driver internally at Xilinx to upstream in near feature. While doing that, the code base may change due to heavy cleanup.
I understand. I am right now shifting the _drv part to an drm_of_component_probe model. I have removed the drm_driver.load and unload functions in favour of the component bind/unbind. We were seeing races in the devices appearing at boot time.
I wonder why you are not sharing the restructuring effort publicly. It would certainly help us track and align our own restructuring in order to reduce code clash upon potential merge, as well as gather early feedback and adoption for the "braver*" ones among us. (*: here "brave" means not close to production/release;)
Anyway, I would love to see the state of your restructure, even if it still doesn't compile or work!
Thanks for your answers!
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 12 lines · Jean-Francois Dagenais
Hi Hyun,
Quoted 4 lines · Hyun Kwon
As you noted, the Xilinx DRM driver in Xilinx tree is missing many mainline features including the atomic mode setting and needs some restructuring. Please feel free to send patches to Xilinx git-dev, but note that we are also developing / cleaning up the driver internally at Xilinx to upstream in near feature. While doing that, the code base may change due to heavy cleanup.
I understand. I am right now shifting the
_drvpart to andrm_of_component_probemodel. I have removed the drm_driver.load and unload functions in favour of the component bind/unbind. We were seeing races in the devices appearing at boot time.
Quoted 8 lines
I wonder why you are not sharing the restructuring effort publicly. It would certainly help us track and align our own restructuring in order to reduce code clash upon potential merge, as well as gather early feedback and adoption for the "braver*" ones among us. (*: here "brave" means not close to production/release;)
Anyway, I would love to see the state of your restructure, even if it still doesn't compile or work!
To encourage collaboration: For upstreaming the first one to submit a reasonable driver wins, 2nd party needs to get their stuff integrated into the already merged driver (if it's for the same hw). Better if you work together openly from the start :-)
Cheers, Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel