cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
thenumberdevil
Explorer
Explorer
1,535 Views
Registered: ‎04-21-2020

driver for screen

HI All,

         What driver we could use to get the data to the display?.

0 Kudos
25 Replies
rfs613
Scholar
Scholar
1,509 Views
Registered: ‎05-28-2013

Can you be more specific - which board are you using, what kind of display (and how is it connected) - does the display currently show anything, or are you adding it for the first time?

0 Kudos
thenumberdevil
Explorer
Explorer
1,501 Views
Registered: ‎04-21-2020

Can you be more specific - which board are you using, what kind of display (and how is it connected) - does the display currently show anything, or are you adding it for the first time?

Board using zc7c702

Display is connected to HDMI out. We have a image pipe. I am writting to one of the layer of the mixture.

Display is showing the logo which is pushed in by baremetal.

When I enable the simpleframebuffer driver and use cat /dev/urandom /dev/fb0 I could see some grains as expected.

But while using the Xserver with Framebuffer driver, I am not seeing anydata.  One observation is that when I use ARGB I do not see anything, But when I use RGB 16 I could see some  image in weird way.

Do I need to use the DRM framework.

0 Kudos
rfs613
Scholar
Scholar
1,490 Views
Registered: ‎05-28-2013

Okay, so the hardware is known to work - seems your problem is getting X configured to match the framebuffer pixel layout. Unfortunately I'm not too familiar with this, so I can just give some ideas. Maybe someone else here can offer you more specific advice.

I'd start by figuring out what pixel format your framebuffer is using. In other words how are Red, Green, Blue values encoded for this framebuffer. How many bits each, which order do the go in. You can do this by trial and error, or you can query it from the kernel, see https://www.kernel.org/doc/html/latest/fb/api.html#format-configuration.

Once you know how pixels are encoded, next step is to configure X server accordingly.

You might also try looking at pre-built sample projects from Xilinx for the zc702 board... pretty sure there are demos that drive HDMI display, perhaps with a full desktop environment.

0 Kudos
thenumberdevil
Explorer
Explorer
1,467 Views
Registered: ‎04-21-2020

@rfs613 

                Thank you for understanding the problem which I am currently facing.

I have a framebuffer driver which is supporting ARGB. I am currently trying to change the Xorg server configuration. To match that 

of the one in the driver. With out any success. As you have mentioned if you can share me some links where I can find the settings it will be of great help. 

 

0 Kudos
rfs613
Scholar
Scholar
1,451 Views
Registered: ‎05-28-2013

Hmm, it has been many years since I configured Xorg.... seems you should be using the fbdev driver, with appropriate depth (probably 24 in your case). Xorg is supposed to query the kernel fbdev to find out what modes it supports, and then adjust itself accordingly.

One thought comes to mind though: when you start Xorg, it will paint the screen black by default. You might see a mouse cursor. Back in the old days, instead of black background, it would draw the "X stipple pattern". This might be more useful to know that things are working (or not). Maybe try starting it with "Xorg -retro" (assuming that flag still exists).

If that doesn't do the trick, you should probably collect the log from Xorg... look through it carefully, try to compare it against a working version (from a Xilinx prebuilt) if possible.

 

0 Kudos
thenumberdevil
Explorer
Explorer
1,344 Views
Registered: ‎04-21-2020

@rfs613 

                I could get the data in the frame buffer memory. But the same is not displayed out. I have two cases.

1. When I do cat /dev/urandom /dev/fb0  I could see the screen getting the data.And change in the display. To cross verify I ran hex-dump on the /dev/fb0 and found that the data reaching the screen.

2.When I run the GUI using the X server, I could see that data is reaching the Frame buffer,But the necessary change is not see in the display,

even a small disturbance could be observed.

Please let me know where and what I have to look for.

0 Kudos
rfs613
Scholar
Scholar
1,331 Views
Registered: ‎05-28-2013

One possible explanation: the framebuffer may provide multiple "pages", only one of which is displayed at a time.

When you do "cat /dev/urandom >/dev/fb0" this will write the entire framebuffer memory, covering all pages (including the one being currently displayed)

When you use the X server, it may not be aware of the pages. So it might be drawing on a page that isn't being displayed. Unfortunately I don't recall details of how X handles page flipping.

It's quite possible that my reply is outdated by newer technology in the display stack. Maybe try downloading a pre-built demo for your board that drives the HDMI, then you can have a look at how they have configured things.

0 Kudos
thenumberdevil
Explorer
Explorer
1,319 Views
Registered: ‎04-21-2020

Hi @rfs613 ,

                       The underlying mixture surface is defined as ARGB. When I define the framebuffer as a RGB(565) , I could see the GUI. But not in the way I expect it . Another observation is that when I do X forwarding in PC I could see the perfect GUI which I am looking for. 

Could you point me to prebuilt demo where I can have a check  at it.

0 Kudos
rfs613
Scholar
Scholar
1,291 Views
Registered: ‎05-28-2013

Xilinx provides pre-built zc702 images with Ubuntu:

There are likely many more derived projects. I have not tried them myself.

Regarding X forwarding, note that this does not involve the framebuffer (or any video hardware on the Zynq board). It's just a network protocol, and all the rendering happens on the remote side (eg. your PC).

0 Kudos
watari
Professor
Professor
1,278 Views
Registered: ‎06-16-2013

Hi @thenumberdevil 

 

Did you make sure whether there is proper capability (especially hardware capability) on your drm or not ?

 

Best regards,

0 Kudos
thenumberdevil
Explorer
Explorer
1,239 Views
Registered: ‎04-21-2020

Hi @watari ,

                     I am using simple framebuffer. With ARGB. When I checked the sysfs configuration I could see that bits per pixel is 32 bits. I providing FRAMEBUFFER=/dev/fb0 to the xserver.

Since the mixture is working I could see the /dev/dri/card0 interface as well. How I can determine the capability of the DRM.

How to ascertain that.

Thank you for your questions and guidance

0 Kudos
thenumberdevil
Explorer
Explorer
1,237 Views
Registered: ‎04-21-2020

Hi @rfs613 ,

                    Thank you for the response. I will look in to the same.

Regards

D.Isaac

0 Kudos
watari
Professor
Professor
1,204 Views
Registered: ‎06-16-2013

Hi @thenumberdevil 

 

> How I can determine the capability of the DRM.

 

You can make sure it by ex. modetest command.

Would you try it ?

 

Also, this link is helpful for you, too

Refer the following URL, too.

 

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842520/Xilinx+DRM+KMS+driver

 

Best regards,

0 Kudos
thenumberdevil
Explorer
Explorer
1,168 Views
Registered: ‎04-21-2020

Hi @watari 

I found a statement in the

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842097/Xilinx+DRM+KMS+MIPI+DSI2-Tx+Driver?view=blog

Since Xorg works with AR24 DRM format (DRM_FORMAT_ARGB8888),
please ensure that this is enabled/supported in Video Framebuffer Read / Video_Mixer IP connected.

My case is similar to this. I would like to know how to  configure the Xorg server for the DRM .

 

Please find the results of the modetest.

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2020.11.05 17:20:33 =~=~=~=~=~=~=~=~=~=~=~=

root@delhi-zc702:~# 
root@delhi-zc702:~# modetest -M xlnx
Encoders:
id	crtc	type	possible crtcs	possible clones	

Connectors:
id	encoder	status		name		size (mm)	modes	encoders

CRTCs:
id	fb	pos	size
33	0	(0,0)	(0x0)
   0 0 0 0 0 0 0 0 0 0 flags: ; type: 
  props:
	20 ACTIVE:
		flags: range
		values: 0 1
		value: 0
	21 MODE_ID:
		flags: blob
		blobs:

		value:
	18 OUT_FENCE_PTR:
		flags: range
		values: 0 18446744073709551615
		value: 0

Planes:
id	crtc	fb	CRTC x,y	x,y	gamma size	possible crtcs
30	0	0	0,0		0,0	0       	0x00000001
  formats: YUYV
  props:
	7 type:
		flags: immutable enum
		enums: Overlay=0 Primary=1 Cursor=2
		value: 0
	16 FB_ID:
		flags: object
		value: 0
	17 IN_FENCE_FD:
		flags: signed range
		values: -1 2147483647
		value: -1
	19 CRTC_ID:
		flags: object
		value: 0
	12 CRTC_X:
		flags: signed range
		values: -2147483648 2147483647
		value: 0
	13 CRTC_Y:
		flags: signed range
		values: -2147483648 2147483647
		value: 0
	14 CRTC_W:
		flags: range
		values: 0 2147483647
		value: 0
	15 CRTC_H:
		flags: range
		values: 0 2147483647
		value: 0
	8 SRC_X:
		flags: range
		values: 0 4294967295
		value: 0
	9 SRC_Y:
		flags: range
		values: 0 4294967295
		value: 0
	10 SRC_W:
		flags: range
		values: 0 4294967295
		value: 0
	11 SRC_H:
		flags: range
		values: 0 4294967295
		value: 0
31	0	0	0,0		0,0	0       	0x00000001
  formats: AB24
  props:
	7 type:
		flags: immutable enum
		enums: Overlay=0 Primary=1 Cursor=2
		value: 0
	16 FB_ID:
		flags: object
		value: 0
	17 IN_FENCE_FD:
		flags: signed range
		values: -1 2147483647
		value: -1
	19 CRTC_ID:
		flags: object
		value: 0
	12 CRTC_X:
		flags: signed range
		values: -2147483648 2147483647
		value: 0
	13 CRTC_Y:
		flags: signed range
		values: -2147483648 2147483647
		value: 0
	14 CRTC_W:
		flags: range
		values: 0 2147483647
		value: 0
	15 CRTC_H:
		flags: range
		values: 0 2147483647
		value: 0
	8 SRC_X:
		flags: range
		values: 0 4294967295
		value: 0
	9 SRC_Y:
		flags: range
		values: 0 4294967295
		value: 0
	10 SRC_W:
		flags: range
		values: 0 4294967295
		value: 0
	11 SRC_H:
		flags: range
		values: 0 4294967295
		value: 0
	29 alpha:
		flags: range
		values: 0 256
		value: 256
32	0	0	0,0		0,0	0       	0x00000001
  formats: NV16
  props:
	7 type:
		flags: immutable enum
		enums: Overlay=0 Primary=1 Cursor=2
		value: 1
	16 FB_ID:
		flags: object
		value: 0
	17 IN_FENCE_FD:
		flags: signed range
		values: -1 2147483647
		value: -1
	19 CRTC_ID:
		flags: object
		value: 0
	12 CRTC_X:
		flags: signed range
		values: -2147483648 2147483647
		value: 0
	13 CRTC_Y:
		flags: signed range
		values: -2147483648 2147483647
		value: 0
	14 CRTC_W:
		flags: range
		values: 0 2147483647
		value: 0
	15 CRTC_H:
		flags: range
		values: 0 2147483647
		value: 0
	8 SRC_X:
		flags: range
		values: 0 4294967295
		value: 0
	9 SRC_Y:
		flags: range
		values: 0 4294967295
		value: 0
	10 SRC_W:
		flags: range
		values: 0 4294967295
		value: 0
	11 SRC_H:
		flags: range
		values: 0 4294967295
		value: 0

Frame buffers:
id	size	pitch

root@delhi-zc702:~# 

 

0 Kudos
dimiter
Contributor
Contributor
1,160 Views
Registered: ‎06-10-2018

Is is ARGB or RGBA?

0 Kudos
watari
Professor
Professor
1,132 Views
Registered: ‎06-16-2013

Hi @thenumberdevil 

 

From your log, there is v_mix IP with 3 ports (3 planes) on DRM and each plane support different format.

So, I suggest you to make sure source module on plane 31 and set proper parameter on plane 31.

Also, because there are something wrong on crtc, encoder and connector, I suggest you to make sure them (connection, description of DT and so on) by proper tools.

 

Would you try them ?

 

Best regards,

0 Kudos
thenumberdevil
Explorer
Explorer
1,016 Views
Registered: ‎04-21-2020

Hi @watari ,

                       In my case I am suspecting that Xorg server is not forwarding the 32 bit RGBA data to the driver. Could it be the case?.

In my case I have a framebuffer driver which is supporting ARGB format, But when I start my GUI using X as the display server, I see the alpha channel being 

cut off and only 24 bit data is forwarded. What I am missing ?

 

 

 

0 Kudos
thenumberdevil
Explorer
Explorer
967 Views
Registered: ‎04-21-2020

Hi @florentw ,

                          Do you have some ideas or thoughts on this topic.

0 Kudos
watari
Professor
Professor
944 Views
Registered: ‎06-16-2013

Hi @thenumberdevil 

 

Did you make sure related parameters and settings on video mixer ?

 

Best regards,

0 Kudos
thenumberdevil
Explorer
Explorer
891 Views
Registered: ‎04-21-2020

Hi @watari ,

                    One of the idea I have was not to use the DRM pipeline instead directly use the simple framebuffer driver for my work. The simple framebuffer supports 

- format: The format of the framebuffer surface. Valid values are:
  - r5g6b5 (16-bit pixels, d[15:11]=r, d[10:5]=g, d[4:0]=b).
  - a8b8g8r8 (32-bit pixels, d[31:24]=a, d[23:16]=b, d[15:8]=g, d[7:0]=r).

If this framebuffer is provided to the Xserver with the a8b8g8r8 , My understanding is that it should work out of box. 

Sorry I did not tryout out DRM, I could not yet get convinced that DRM is the issue. . Correct me If I am wrong?. 

0 Kudos
watari
Professor
Professor
839 Views
Registered: ‎06-16-2013

Hi @thenumberdevil 

 

>If this framebuffer is provided to the Xserver with the a8b8g8r8 , My understanding is that it should work out of box.

 

What do you mean ? You'd like to use framebuffer without DRM, even if you use Xserver ?

If yes, I'm sure that you can't achieve what you want to do.

 

In this case, as I already mentioned before, you make sure wrong DRM setting and your design on DRM.

 

https://forums.xilinx.com/t5/Embedded-Linux/driver-for-screen/m-p/1170482/highlight/true#M46528

 

Best regards,

0 Kudos
thenumberdevil
Explorer
Explorer
826 Views
Registered: ‎04-21-2020

Hi @watari ,

                      Thank you for your quick reply. I would like to put in my arguments before I move in the direction which you have pointed me to move in.

Why I believe frame buffer is ok

  1. When I specify the framebuffer format as 565 which is 16 bit I see some GUI components which appear in the screen, even though it does not match the stride and the format of the underlying frame size.
  2. With the simple framebuffer driver I could get the /dev/fb0 device file, To verify if that works I do cat /dev/random /dev/fb0 in this case I see some grains and data in the frame buffer.
  3. I am using the Hex dump tool and checking the /dev/fb0 memory location and I could see the change in the data as well change in the grains in the display.
  4. When I provide export FRAMEBUFFER =/dev/fb0 I expect the xserver to use this device path for writing the data it generates  to the memory location, as in the above case.

@watari  I have stated what I believe is a straight forward solution. I could not comprehend and convince my self why I should choose DRM when I have a straightforward solution?.

As you have mentioned the DRM subsystem which I have configured is having a problem. But by solving it , how I will achieve the desired result.

Thank you for having a conversation with me and opening my eyes

 

 

 

0 Kudos
thenumberdevil
Explorer
Explorer
758 Views
Registered: ‎04-21-2020

Hi @watari ,

                    Do my question make sense?. or I have understood completely wrong.

0 Kudos
watari
Professor
Professor
742 Views
Registered: ‎06-16-2013

Hi @thenumberdevil 

 

I saw like your concept at 90's. But It's makes sense, if you use fundamental 2D graphics via CPU resource.

 

Best regards,

0 Kudos
thenumberdevil
Explorer
Explorer
708 Views
Registered: ‎04-21-2020

Hi  @watari ,

                      Thank you for the information. But I would like to know the work how I can get the Xserver  respect the ARGB color format.

 

0 Kudos