[Intel-gfx] [PATCH 1/2] set output clone mask to share the same pipe.

ling.ma at intel.com ling.ma at intel.com
Mon Jun 29 17:30:52 CEST 2009


According to Bspec CRT can share pipe with SDVO B & C (non-TV),
SDVO-LVDS. However SDVO-TV, HDMIB and HDMIC will occupy one
pipe exclusively. In this patch we define clone mask for different
output respectively, and set clone index by clone mask, insead of
output type.

It fixed freedesktop.org bug #22247

Signed-off-by: Ma Ling <ling.ma at intel.com>
---
In KMS mode, currently drm ignore clone mode, but we will implement it soon.

 src/i830.h         |    9 ++++++---
 src/i830_crt.c     |    4 +++-
 src/i830_display.c |    6 ++++--
 src/i830_driver.c  |    4 +++-
 src/i830_hdmi.c    |   12 +++++++-----
 src/i830_sdvo.c    |    7 ++++++-
 6 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/src/i830.h b/src/i830.h
index 25ed424..2dd897a 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -199,9 +199,12 @@ typedef struct {
 #define I830_OUTPUT_DVO_LVDS 3
 #define I830_OUTPUT_DVO_TVOUT 4
 #define I830_OUTPUT_SDVO 5
-#define I830_OUTPUT_LVDS 6
-#define I830_OUTPUT_TVOUT 7
-#define I830_OUTPUT_HDMI 8
+#define I830_OUTPUT_SDVO_LVDS 6
+#define I830_OUTPUT_SDVO_TV 7
+#define I830_OUTPUT_LVDS 8
+#define I830_OUTPUT_TVOUT 9
+#define I830_OUTPUT_HDMIB 10
+#define I830_OUTPUT_HDMIC 11
 
 struct _I830DVODriver {
    int type;
diff --git a/src/i830_crt.c b/src/i830_crt.c
index 536d63d..f97d970 100644
--- a/src/i830_crt.c
+++ b/src/i830_crt.c
@@ -549,8 +549,10 @@ i830_crt_init(ScrnInfoPtr pScrn)
     else
 	i830_output->pipe_mask = ((1 << 0) | (1 << 1));
     i830_output->clone_mask = ((1 << I830_OUTPUT_ANALOG) |
+                               (1 << I830_OUTPUT_SDVO) |
+                               (1 << I830_OUTPUT_SDVO_LVDS) |
 			       (1 << I830_OUTPUT_DVO_TMDS));
-    
+
     output->driver_private = i830_output;
     output->interlaceAllowed = FALSE;
     output->doubleScanAllowed = FALSE;
diff --git a/src/i830_display.c b/src/i830_display.c
index a7eafb9..b9346c5 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -418,7 +418,8 @@ static const intel_limit_t *intel_limit_g4x (xf86CrtcPtr crtc)
             limit = &intel_limits[INTEL_LIMIT_G4X_DUAL_LVDS];
         } else /* LVDS with single channel */
             limit = &intel_limits[INTEL_LIMIT_G4X_SINGLE_LVDS];
-    } else if (i830PipeHasType (crtc, I830_OUTPUT_HDMI) ||
+    } else if (i830PipeHasType (crtc, I830_OUTPUT_HDMIB) ||
+               i830PipeHasType (crtc, I830_OUTPUT_HDMIC) ||
                i830PipeHasType (crtc, I830_OUTPUT_ANALOG)) {
         limit = &intel_limits[INTEL_LIMIT_G4X_HDMI_DAC];
     } else if (i830PipeHasType (crtc, I830_OUTPUT_SDVO)) {
@@ -1535,7 +1536,8 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
 	    lvds_bits = intel_output->lvds_bits;
 	    break;
 	case I830_OUTPUT_SDVO:
-	case I830_OUTPUT_HDMI:
+	case I830_OUTPUT_HDMIB:
+	case I830_OUTPUT_HDMIC:
 	    is_sdvo = TRUE;
 	    if (intel_output->needs_tv_clock)
 		is_tv = TRUE;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 23690cf..dc980b0 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -676,7 +676,7 @@ i830_output_clones (ScrnInfoPtr pScrn, int type_mask)
     {
 	xf86OutputPtr		output = config->output[o];
 	I830OutputPrivatePtr	intel_output = output->driver_private;
-	if (type_mask & (1 << intel_output->type))
+	if (type_mask & intel_output->clone_mask)
 	    index_mask |= (1 << o);
     }
     return index_mask;
@@ -745,6 +745,8 @@ I830SetupOutputs(ScrnInfoPtr pScrn)
       }
       output->possible_crtcs = crtc_mask;
       output->possible_clones = i830_output_clones (pScrn, intel_output->clone_mask);
+      xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "possible clones of output %s is %x ",
+		      output->name,output->possible_clones);
    }
 }
 
diff --git a/src/i830_hdmi.c b/src/i830_hdmi.c
index 63fc6dc..2f5f1ad 100644
--- a/src/i830_hdmi.c
+++ b/src/i830_hdmi.c
@@ -352,16 +352,18 @@ i830_hdmi_init(ScrnInfoPtr pScrn, int output_reg)
     dev_priv->has_hdmi_sink = FALSE;
 
     intel_output->dev_priv = dev_priv;
-    intel_output->type = I830_OUTPUT_HDMI;
     intel_output->pipe_mask = ((1 << 0) | (1 << 1));
-    intel_output->clone_mask = (1 << I830_OUTPUT_HDMI);
 
     /* Set up the DDC bus. */
-    if (output_reg == SDVOB)
+    if (output_reg == SDVOB) {
+        intel_output->type = I830_OUTPUT_HDMIB;
+        intel_output->clone_mask = (1 << I830_OUTPUT_HDMIB);
 	I830I2CInit(pScrn, &intel_output->pDDCBus, GPIOE, "HDMIDDC_B");
-    else
+    } else {
+        intel_output->type = I830_OUTPUT_HDMIC;
+        intel_output->clone_mask = (1 << I830_OUTPUT_HDMIC);
 	I830I2CInit(pScrn, &intel_output->pDDCBus, GPIOD, "HDMIDDC_C");
-
+    }
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 	       "HDMI output %d detected\n",
 	       (output_reg == SDVOB) ? 1 : 2);
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index acfe599..b09012b 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -1617,6 +1617,7 @@ i830_sdvo_output_setup (xf86OutputPtr output, uint16_t flag)
 	name_prefix="TV";
 	dev_priv->is_tv = TRUE;
 	intel_output->needs_tv_clock = TRUE;
+        intel_output->clone_mask = 1 << I830_OUTPUT_SDVO_TV;
     }
     else if (flag & SDVO_OUTPUT_CVBS0)
     {
@@ -1625,6 +1626,7 @@ i830_sdvo_output_setup (xf86OutputPtr output, uint16_t flag)
 	name_prefix="TV";
 	dev_priv->is_tv = TRUE;
 	intel_output->needs_tv_clock = TRUE;
+        intel_output->clone_mask = 1 << I830_OUTPUT_SDVO_TV;
     }
     else if (flag & SDVO_OUTPUT_RGB0)
     {
@@ -1645,6 +1647,8 @@ i830_sdvo_output_setup (xf86OutputPtr output, uint16_t flag)
         output->subpixel_order = SubPixelHorizontalRGB;
         name_prefix="LVDS";
         dev_priv->is_lvds = TRUE;
+        intel_output->clone_mask = ((1 << I830_OUTPUT_SDVO_LVDS) |
+                                    (1 << I830_OUTPUT_ANALOG));
     } else {
 	unsigned char	bytes[2];
 
@@ -2231,7 +2235,8 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
     
     intel_output->type = I830_OUTPUT_SDVO;
     intel_output->pipe_mask = ((1 << 0) | (1 << 1));
-    intel_output->clone_mask = (1 << I830_OUTPUT_SDVO);
+    intel_output->clone_mask = ((1 << I830_OUTPUT_SDVO) |
+                                (1 << I830_OUTPUT_ANALOG));
 
     /* While it's the same bus, we just initialize a new copy to avoid trouble
      * with tracking refcounting ourselves, since the XFree86 DDX bits don't.
-- 
1.5.4.4




More information about the Intel-gfx mailing list