From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Greene Subject: SDL and drm driver Date: Tue, 2 Feb 2016 23:56:53 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1387598109==" Return-path: Received: from mxout02.autodesk.com (mxout02.autodesk.com [132.188.64.232]) by gabe.freedesktop.org (Postfix) with ESMTPS id DF3886E63F for ; Tue, 2 Feb 2016 16:12:58 -0800 (PST) Received: from [141.251.76.210] (helo=005-smtp-out.autodesk.com) by mxout02.autodesk.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.80.1) (envelope-from ) id 1aQkoZ-0005nY-D4 for dri-devel@lists.freedesktop.org; Tue, 02 Feb 2016 15:56:55 -0800 Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: "dri-devel@lists.freedesktop.org" Cc: Jason Lefley List-Id: dri-devel@lists.freedesktop.org --===============1387598109== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_D2D6824417406richardgreeneautodeskcom_" --_000_D2D6824417406richardgreeneautodeskcom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I'm finding that attempts to change the video mode via libdrm don't allow S= DL to use that mode, and I'm wondering if anyone can tell me why or what I = might need to do to make it work. I'm using SDL 1.2 on a BeagleBone Black running Wheezy, 3.8.13-bone71, and = Rob Clark's tilcdc/tda998x drm driver. I can boot into either of two video= modes using the appropriate kms_force_mode setting in uEnv.txt. When I ru= n a modified version of modetest (built from git://anongit.freedesktop.org/= mesa/drm) that sets the opposite mode from the one defined in uEnv.txt and = then calls SDL_Init and SDL_GetVideoInfo, the later always finds the same m= ode as was set in uEnv.txt. Then a call to SDL_SetVideoMode (also with the= opposite of the uEnv.txt mode) always fails, just as it does if I hadn't a= ttempted to change the mode via libdrm. For example, when this line is in uEnv.txt: kms_force_mode=3Dvideo=3DHDMI-A-1:912x1140M@60 and in the modified modetest, with count =3D=3D 1, I call: parse_connector(&pipe_args[count], "5:1280x800") ... set_mode(&dev, pipe_args, count) It then reports: setting mode 1280x800-60Hz@XR24 on connectors 5, crtc 3 But SDL_GetVideoInfo still reports the mode as 912x1140, and on attempting = to use SDL_SetVideoMode to set it to 1280x800, it fails with the error mess= age: No video mode large enough for 1280x800 FYI, the output of the (unmodified) modetest when using this same uEnv.txt = file is shown below. Richard trying to open device 'i915'...failed trying to open device 'radeon'...failed trying to open device 'nouveau'...failed trying to open device 'vmwgfx'...failed trying to open device 'omapdrm'...failed trying to open device 'exynos'...failed trying to open device 'tilcdc'...done Encoders: id crtc type possible crtcs possible clones 4 3 TMDS 0x00000001 0x00000000 Connectors: id encoder status name size (mm) modes encoders 5 4 connected HDMI-A-1 520x320 4 4 modes: name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot) 1280x800 60 1280 1352 1480 1680 800 810 816 831 flags: phsync, pvsync; ty= pe: preferred, driver 912x1140 60 912 952 1016 1192 1140 1150 1156 1170 flags: phsync, pvsync; = type: driver 752x470 70 752 776 856 960 470 471 474 490 flags: nhsync, pvsync; type: 720x450 60 720 736 808 896 450 451 454 466 flags: nhsync, pvsync; type: props: 1 EDID: flags: immutable blob blobs: value: 00ffffffffffff001190004501000000 0d170103803420a002ee95a3544c9926 0f505400000001000100010001000100 0100010001009e20009051201f304880 a60006442100001ea820901831741e40 2840a60006442100001e000000fc004c 437220343530300a20202020000000fa 001d003b003f0a2020010001000a00db 2 DPMS: flags: enum enums: On=3D0 Standby=3D1 Suspend=3D2 Off=3D3 value: 1 CRTCs: id fb pos size 3 10 (0,0) (912x1140) 912x1140 60 912 952 1016 1192 1140 1150 1156 1170 flags: phsync, pvsync; = type: driver props: Planes: id crtc fb CRTC x,y x,y gamma size possible crtcs Frame buffers: id size pitch --_000_D2D6824417406richardgreeneautodeskcom_ Content-Type: text/html; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable
Hello,

I'm finding that attempts to change the video mode via libdrm don't al= low SDL to use that mode, and I'm wondering if anyone can tell me why or wh= at I might need to do to make it work.

I'm using SDL 1.2 on a BeagleBone Black running Wheezy, 3.8.13-bone71,= and Rob Clark's tilcdc/tda998x drm driver.  I can boot into eith= er of two video modes using the appropriate kms_force_mode setting in uEnv.= txt.  When I run a modified version of modetest (built from git://anongit.freedesk= top.org/mesa/drm) that sets the opposite mode from the one defined in uEnv.txt and then calls SDL_Ini= t and SDL_GetVideoInfo, the later always finds the same mode as was set in = uEnv.txt.  Then a call to SDL_SetVideoMode (also with the opposit= e of the uEnv.txt mode) always fails, just as it does if I hadn't attempted to change the mode via libdrm.

For example, when this line is in uEnv.txt:
kms_force_mode=3Dvideo=3DHDMI-A-1:912x1140M@60

and in the modified modetest, with count =3D=3D 1, I call:

parse_connec= tor(&pipe_args[count], "5:1280x800")

set_mode(&am= p;dev, pipe_args, count)


It then repo= rts:

setting mode= 1280x800-60Hz@XR24 on connectors 5, crtc 3


But SDL_GetVide= oInfo still reports the mode as 912x1140, and on attempting to use SDL_= SetVideoMode to set it to 1280x800, it fails with the error message: 

No video mod= e large enough for 1280x800


FYI, the out= put of the (unmodified) modetest when using this same uEnv.txt file is show= n below.


Richard

trying to op= en device 'i915'...failed

trying to op= en device 'radeon'...failed

trying to op= en device 'nouveau'...failed

trying to op= en device 'vmwgfx'...failed

trying to op= en device 'omapdrm'...failed

trying to op= en device 'exynos'...failed

trying to op= en device 'tilcdc'...done

Encoders:

id crtc type possible crtcs possible clones

4 3 TM= DS 0x00000001 = 0x00000000


Connectors:<= /p>

id encoder status name size (mm) modes encoders

5 4 co= nnected HDMI-A-1       520x320 4 4<= /p>

  modes= :

name refresh (Hz) hdis= p hss hse htot vdisp vss vse vtot)

  1280x= 800 60 1280 1352 1480 1680 800 810 816 831 flags: phsync, pvsync; type: pre= ferred, driver

  912x1= 140 60 912 952 1016 1192 1140 1150 1156 1170 flags: phsync, pvsync; type: d= river

  752x4= 70 70 752 776 856 960 470 471 474 490 flags: nhsync, pvsync; type: 

  720x4= 50 60 720 736 808 896 450 451 454 466 flags: nhsync, pvsync; type: 

  props= :

1 EDID:

flags: immutable blob<= /p>

blobs:


value:

00ffffffffffff00119000= 4501000000

0d170103803420a002ee95= a3544c9926

0f50540000000100010001= 0001000100

0100010001009e20009051= 201f304880

a60006442100001ea82090= 1831741e40

2840a60006442100001e00= 0000fc004c

437220343530300a202020= 20000000fa

001d003b003f0a20200100= 01000a00db

2 DPMS:

flags: enum

enums: On=3D0 Standby= =3D1 Suspend=3D2 Off=3D3

value: 1


CRTCs:

id fb p= os size

3 10 (= 0,0) (912x1140)

  912x1= 140 60 912 952 1016 1192 1140 1150 1156 1170 flags: phsync, pvsync; type: d= river

  props= :


Planes:

id crtc fb CRTC x,y x,y gamma size = possible crtcs


Frame buffer= s:

id size pitch


--_000_D2D6824417406richardgreeneautodeskcom_-- --===============1387598109== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9kcmktZGV2ZWwK --===============1387598109==--