Hi all,

I added the necessary code to make displays recognize 3D modes and switch
to 3D mode automatically.

Background:
There are 3 major 3D modes
Side-By-Side (SBS) where the left eye and right eye pictures are scaled to
1/2 the horizontal resolution, stacked side by side and transmitted as a
single 1920x1080 image.
Top-and-Bottom (TB, sometimes called Over-Under), same as SBS but vertical
stacking
Frame-Packing (FP) no scaling - vertical resolution is doubled + 45 lines
images are transmitted as: left, 45 blank lines, right. (Note that standard
mandates that the vertical blanking also be 45 lines for this mode to work)

For the projector / TV to automatically switch to the correct mode, it
receives the type of mode in the HDMI InfoFrame.
The Linux kernel DRM supports generating the correct InfoFrames and expects
the 3D mode to be supplied in mode-line flags (same as HSync, Interlace,
etc).

Attached are the patches to just pass the flags to the kernel.
I did not add the support to the xorg.conf parser yet - I'll do that after
I'll get an OK from you guys that I'm on the right track.
also, its my first git patch sending. I hope I'm ok...

and a question:
The kernel automatically calculates the correct vertical mode-line
parameters (basically adds VTotal to each field) so in effect we need to
pass it a '1920x1080' modeline with a 3D_FP flag and it will double the
vertical. The problem is that the X will still think that the root window
size is 1080 and not 2205. How should I go about fixing that?

Regards,
Or Tal.
From 4fcfc98ec4768107f90640517b5ae7f9187e9267 Mon Sep 17 00:00:00 2001
From: Or Tal <[email protected]>
Date: Tue, 23 Jun 2015 20:53:53 +0300
Subject: [PATCH] Added Modeline flags for 3D

---
 hw/xfree86/modes/xf86RandR12.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 0d446da..391377f 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -992,7 +992,8 @@ xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y)
 		   RR_BCast | \
 		   RR_PixelMultiplex | \
 		   RR_DoubleClock | \
-		   RR_ClockDivideBy2)
+		   RR_ClockDivideBy2 | \
+		   RR_3DMask)
 
 static Bool
 xf86RandRModeMatches(RRModePtr randr_mode, DisplayModePtr mode)
-- 
2.1.4

From 95fb9e6a2a7b6fb051cb0a55714f301884be59f5 Mon Sep 17 00:00:00 2001
From: Or Tal <[email protected]>
Date: Tue, 23 Jun 2015 20:53:01 +0300
Subject: [PATCH] Added Modeline flags for 3D

---
 xrandr.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xrandr.c b/xrandr.c
index fbfd93e..552e639 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -91,6 +91,10 @@ static const struct {
     { "CSync",	    RR_CSync },
     { "+CSync",	    RR_CSyncPositive },
     { "-CSync",	    RR_CSyncNegative },
+    { "3D_FP",      RR_3DFramePacking },
+    { "3D_SBSF",    RR_3DSideBySideFull },
+    { "3D_TB",      RR_3DTopAndBottom },
+    { "3D_SBS",    RR_3DSideBySide }, /* Normal SBS is 'half' by default */
     { NULL,	    0 }
 };
 
@@ -148,6 +152,7 @@ usage(void)
            "            [flags...]\n"
            "            Valid flags: +HSync -HSync +VSync -VSync\n"
            "                         +CSync -CSync CSync Interlace DoubleScan\n"
+           "                         3D_FP 3D_SBSF 3D_TB 3D_SBS\n"
            "  --rmmode <name>\n"
            "  --addmode <output> <name>\n"
            "  --delmode <output> <name>\n"
-- 
2.1.4

From 3189143d65fbdd3121a1fc8f3ce85e51248d51cb Mon Sep 17 00:00:00 2001
From: Or Tal <[email protected]>
Date: Tue, 23 Jun 2015 20:51:19 +0300
Subject: [PATCH] Added Modeline flags for 3D

---
 randr.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/randr.h b/randr.h
index 6fcda87..4f69694 100644
--- a/randr.h
+++ b/randr.h
@@ -163,6 +163,13 @@ typedef unsigned long	XRandrModeFlags;
 #define RR_PixelMultiplex	0x00000800
 #define RR_DoubleClock		0x00001000
 #define RR_ClockDivideBy2	0x00002000
+/* 3D flags. These are not bit field but a number that takes 5 bits.
+   (mask is 0x1f << 14) */
+#define RR_3DFramePacking	(1 << 14)
+#define RR_3DSideBySideFull 	(4 << 14)
+#define RR_3DTopAndBottom	(7 << 14)
+#define RR_3DSideBySide		(8 << 14)
+#define RR_3DMask		(0x1f << 14)
 
 #define RR_Connected		0
 #define RR_Disconnected		1
-- 
2.1.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to