Bug 9664 - patch to control mergedfb options (swap screen, nonrect, mouse restrictions)
Summary: patch to control mergedfb options (swap screen, nonrect, mouse restrictions)
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: 7.1 (2006.05)
Hardware: x86 (IA32) Linux (All)
: high enhancement
Assignee: Alan Hourihane
QA Contact:
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2007-01-15 00:57 UTC by Emilio Scalise
Modified: 2007-01-15 09:23 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch to control mergedfb options (1.89 KB, patch)
2007-01-15 08:41 UTC, Emilio Scalise
no flags Details | Splinter Review

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.