Bug 9664

Summary: patch to control mergedfb options (swap screen, nonrect, mouse restrictions)
Product: xorg Reporter: Emilio Scalise <emisca.ml>
Component: Driver/intelAssignee: Alan Hourihane <alanh>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: high Keywords: patch
Version: 7.1 (2006.05)   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
patch to control mergedfb options none

Description Emilio Scalise 2007-01-15 00:57:19 UTC
This is a patch I made to add options to control mergedfb behaviour, using
options similar to those present in radeon driver.
MergedXineramaSecondIsScreen0 swaps the logical Xinerama screen in mergedfb mode.
MergedNonRectangular allows to have different resolutions.
MergedMouseRestriction restrict mouse movement to display size when using non
rectangular framebuffer.

I tried to use naming conventions similar to other options. Patch is against
1.7.2 version, but it's suitable also for 1.7.3 and 1.7.4 versions..

Bye

--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -268,6 +268,9 @@
    OPTION_SECONDHSYNC,
    OPTION_SECONDVREFRESH,
    OPTION_SECONDPOSITION,
+   OPTION_SECONDISSCRN0,
+   OPTION_MERGEDFBNONRECT,
+   OPTION_MERGEDFBMOUSER,
    OPTION_INTELXINERAMA
 } I830Opts;

@@ -292,6 +295,9 @@
    {OPTION_LINEARALLOC, "LinearAlloc",  OPTV_INTEGER,   {0},    FALSE},
    {OPTION_MERGEDFB,   "MergedFB",     OPTV_BOOLEAN,   {0},    FALSE},
    {OPTION_METAMODES,  "MetaModes",    OPTV_STRING,    {0},    FALSE},
+   {OPTION_SECONDISSCRN0,"MergedXineramaSecondIsScreen0", OPTV_BOOLEAN, {0},
FALSE },
+   {OPTION_MERGEDFBNONRECT,"MergedNonRectangular",OPTV_BOOLEAN,        {0},  
FALSE},
+   {OPTION_MERGEDFBMOUSER,"MergedMouseRestriction",OPTV_BOOLEAN, {0},    FALSE},
    {OPTION_SECONDHSYNC,        "SecondMonitorHorizSync",OPTV_STRING,   {0},
FALSE },
    {OPTION_SECONDVREFRESH,"SecondMonitorVertRefresh",OPTV_STRING,{0}, FALSE },
    {OPTION_SECONDPOSITION,"SecondPosition",OPTV_STRING,        {0},    FALSE },
@@ -4685,6 +4691,25 @@
          }
          xfree(tempstr);
       }
+
+      /* If OPTION_SECONDISSCRN0 is true then swap screens */
+      if(xf86GetOptValBool(pI830->Options, OPTION_SECONDISSCRN0, TRUE)) {
+        if (pI830->SecondIsScrn0) pI830->SecondIsScrn0= FALSE;
+        else pI830->SecondIsScrn0= TRUE;
+      }
+
+      /* Set pI830->NonRect according to OPTION_MERGEDFBNONRECT */
+      if(xf86GetOptValBool(pI830->Options, OPTION_MERGEDFBNONRECT, TRUE))
+             pI830->NonRect = TRUE;
+      else
+             pI830->NonRect = FALSE;
+
+      /* Set pI830->MouseRestrictions according to OPTION_MERGEDFBMOUSER */
+      if(xf86GetOptValBool(pI830->Options, OPTION_MERGEDFBMOUSER, TRUE))
+              pI830->MouseRestrictions = TRUE;
+      else
+              pI830->MouseRestrictions = FALSE;
+
       if((s = (char *)xf86GetOptValString(pI830->Options, OPTION_METAMODES))) {
          pI830->MetaModes = xalloc(strlen(s) + 1);
         if(pI830->MetaModes)
Comment 1 Alan Hourihane 2007-01-15 02:06:02 UTC
Can you use the "Create a New Attachment" feature and attach this as an actual
patch rather than inlining it.

Thanks.
Comment 2 Emilio Scalise 2007-01-15 08:41:40 UTC
Created attachment 8402 [details] [review]
patch to control mergedfb options
Comment 3 Emilio Scalise 2007-01-15 08:42:59 UTC
(In reply to comment #2)
> Created an attachment (id=8402) [edit]
> patch to control mergedfb options
> 

Sorry I didn't know these bugzilla features about patches... there is always
something new to learn!
Comment 4 Alan Hourihane 2007-01-15 09:23:19 UTC
Applied. Closing.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.