On Fri, Oct 17, 2003 at 10:32:28PM -0400, David Dawes wrote:
>On Fri, Oct 17, 2003 at 02:15:20PM -0700, Tim Roberts wrote:
>>On Fri, 17 Oct 2003 23:44:57 +0300, Alexander Shopov wrote:
>>>
>>>I checked driver man pages in xc/programs/Xserver/hw/xfree86/drivers/*/*.man
>>>Almost every driver implements the options:
>>>HWCursor, SWCursor however they are documented differently.
>>
>>Further, having two separate options is silly.  It is a two-state switch:
>>either the driver tries to use a HW cursor, or it always forces a SW
>>cursor.  What happens if you specify both, or neither?  I'll bet different
>>drivers come to different conclusions.
>
>The presence of both is probably historical.  Some drivers have one,
>some both.  The mga driver seems to define both, but only checks one.
>
>If you specify neither, the driver should default to "whatever works
>best".  That's the driver's call, but it should generally be HW cursor
>when available.
>
>Specifying both would be "undefined" in general, if both were specifying
>contrary behaviour.
>
>One way to handle the naming more uniformly might be to define the
>concept of option aliases, with, say, "SWCursor" aliased to "NoHWCursor".
>That would make the "specifying both" behaviour well-defined too.

I've just committed a small change to the OptionInfoRec lookup code that
allows a simple form of aliasing for these types of options.  Instead
of returning the first entry matching the token it now favours the first
matching entry that has been set (if one is).  If two options with the
same token are both specified in the config file, the first in the
driver's list takes precedence.

If someone wants to generate a patch for various drivers that makes
these two options equivalent via this aliasing mechanism (and the same
for any other cases where two different option names are used to control
the same thing), it would be considered as a bug fix for 4.4.

Here is a sample patch for the radeon driver that I used for testing.
It also makes the declared but unused dac8bit option usable (another
example of two options names serving the same purpose).

Index: radeon_driver.c
===================================================================
RCS file: /home/x-cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v
retrieving revision 1.109
diff -u -r1.109 radeon_driver.c
--- radeon_driver.c     11 Oct 2003 00:29:57 -0000      1.109
+++ radeon_driver.c     18 Oct 2003 12:19:23 -0000
@@ -112,7 +112,6 @@
     OPTION_NOACCEL,
     OPTION_SW_CURSOR,
     OPTION_DAC_6BIT,
-    OPTION_DAC_8BIT,
 #ifdef XF86DRI
     OPTION_IS_PCI,
     OPTION_BUS_TYPE,
@@ -144,8 +143,9 @@
 const OptionInfoRec RADEONOptions[] = {
     { OPTION_NOACCEL,        "NoAccel",          OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_SW_CURSOR,      "SWcursor",         OPTV_BOOLEAN, {0}, FALSE },
+    { OPTION_SW_CURSOR,      "NoHWcursor",       OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_DAC_6BIT,       "Dac6Bit",          OPTV_BOOLEAN, {0}, FALSE },
-    { OPTION_DAC_8BIT,       "Dac8Bit",          OPTV_BOOLEAN, {0}, TRUE  },
+    { OPTION_DAC_6BIT,       "NoDac8Bit",        OPTV_BOOLEAN, {0}, FALSE },
 #ifdef XF86DRI
     { OPTION_IS_PCI,         "ForcePCIMode",     OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_BUS_TYPE,       "BusType",          OPTV_ANYSTR,  {0}, FALSE },


David
-- 
David Dawes                                     X-Oz Technologies
www.XFree86.org/~dawes                          www.x-oz.com
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to