open-src/xserver/xorg/6535006.patch
author Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
Mon, 14 Mar 2011 15:37:30 -0700
changeset 1088 1c99106ccbe0
parent 851 d428083dbbdd
permissions -rw-r--r--
6983602 Xorg 1.9 integration [PSARC/2011/008]
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1088
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 851
diff changeset
     1
diff -Nurp -x '*~' -x '*.orig' hw/xfree86/common/xf86Mode.c hw/xfree86/common/xf86Mode.c
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 851
diff changeset
     2
--- hw/xfree86/common/xf86Mode.c	2010-09-03 16:45:23.099750744 -0700
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 851
diff changeset
     3
+++ hw/xfree86/common/xf86Mode.c	2010-09-03 16:45:25.275951707 -0700
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 851
diff changeset
     4
@@ -1563,7 +1563,45 @@ xf86ValidateModes(ScrnInfoPtr scrp, Disp
140
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
     5
 	virtX = virtualX;
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
     6
 	virtY = virtualY;
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
     7
 	scrp->virtualFrom = X_CONFIG;
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
     8
-    } else if (!modeNames || !*modeNames) {
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
     9
+    } 
154
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    10
+
140
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    11
+    if  ((modeNames == NULL) || (*modeNames == NULL)) {
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    12
+	if (UseDefaultRate) {
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    13
+	    modeNames = xnfcalloc(2, sizeof(char *));
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    14
+	    modeNames[0] = strdup("1024x768");
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    15
+	    modeNames[1] = NULL;
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    16
+	} else {
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    17
+	    char *mode_pref = NULL;
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    18
+	    const int types[] = {
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    19
+            	M_T_BUILTIN | M_T_PREFERRED,
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    20
+            	M_T_USERDEF | M_T_PREFERRED,
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    21
+            	M_T_DRIVER | M_T_PREFERRED
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    22
+		};
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    23
+	    const int ntypes = sizeof(types) / sizeof(int);
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    24
+	    int n, type;
154
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    25
+	    DisplayModePtr modes = scrp->modePool ? scrp->modePool : availModes;
140
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    26
+
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    27
+	    for (n = 0; n < ntypes; n++) {
154
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    28
+	        type = types[n];
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    29
+		
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    30
+	    	for (p = modes;  p != NULL;  p = p->next) {
140
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    31
+	    	    if ((p->type & type) == type) {
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    32
+		    	mode_pref = strdup(p->name);
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    33
+		    	break;
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    34
+	    	    }
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    35
+	    	}
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    36
+	    	if (mode_pref)
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    37
+		    break;
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    38
+	    }
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    39
+	    if (mode_pref) {
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    40
+	    	modeNames = xnfcalloc(2, sizeof(char *));
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    41
+	    	modeNames[0] = strdup(mode_pref);
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    42
+	    	modeNames[1] = NULL;
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    43
+	    }
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    44
+	}
154
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    45
+    }
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    46
+
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    47
+    if ((virtualY <= 0) && (!modeNames || !*modeNames)) {
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    48
 	/* No virtual size given in the config, try to infer */
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    49
 	/* XXX this doesn't take m{in,ax}Pitch into account; oh well */
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    50
 	inferred_virtual = inferVirtualSize(scrp, availModes, &virtX, &virtY);
1088
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 851
diff changeset
    51
@@ -1628,12 +1666,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, Disp
154
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    52
 	xf86DeleteMode(&scrp->modes, scrp->modes);
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    53
     endp = &scrp->modes;
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    54
     last = NULL;
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    55
-    if (UseDefaultRate && ((modeNames == NULL) || (*modeNames == NULL))) {
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    56
-	modeNames = xnfcalloc(2, sizeof(char *));
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    57
-	modeNames[0] = strdup("1024x768");
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    58
-	modeNames[1] = NULL;
ae2bd8710ae2 6540484: ast_drv.so in S10 U4 build3 and nv_60 will cause GUI garbled up
Henry Zhao <Henry.Zhao@Sun.COM>
parents: 140
diff changeset
    59
-    }
140
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    60
-    if (modeNames != NULL) {
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    61
+    if ((modeNames != NULL) && (*modeNames != NULL)) {
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    62
 	for (i = 0; modeNames[i] != NULL; i++) {
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    63
 	    userModes = TRUE;
fb0ff1642f9a 6535006:Install Window is too small for x86 for certain monitors for snv_58 and s10u4_03
Henry Zhao <Henry.Zhao@Sun.COM>
parents:
diff changeset
    64
 	    new = xnfcalloc(1, sizeof(DisplayModeRec));