Sat Jun 16 01:25:23 2018 UTC ()
explicitly turn off tiling translation - now software rendered characters
look right again on r3xx hardware


(macallan)
diff -r1.97 -r1.98 src/sys/dev/pci/radeonfb.c

cvs diff -r1.97 -r1.98 src/sys/dev/pci/radeonfb.c (expand / switch to unified diff)

--- src/sys/dev/pci/radeonfb.c 2018/06/15 21:22:35 1.97
+++ src/sys/dev/pci/radeonfb.c 2018/06/16 01:25:23 1.98
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: radeonfb.c,v 1.97 2018/06/15 21:22:35 macallan Exp $ */ 1/* $NetBSD: radeonfb.c,v 1.98 2018/06/16 01:25:23 macallan Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006 Itronix Inc. 4 * Copyright (c) 2006 Itronix Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Garrett D'Amore for Itronix Inc. 7 * Written by Garrett D'Amore for Itronix Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -60,27 +60,27 @@ @@ -60,27 +60,27 @@
60 * portions of the Software. 60 * portions of the Software.
61 * 61 *
62 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 62 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
63 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 63 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
64 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 64 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
65 * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR 65 * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR
66 * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 66 * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
67 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 67 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
68 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 68 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
69 * DEALINGS IN THE SOFTWARE. 69 * DEALINGS IN THE SOFTWARE.
70 */ 70 */
71 71
72#include <sys/cdefs.h> 72#include <sys/cdefs.h>
73__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.97 2018/06/15 21:22:35 macallan Exp $"); 73__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.98 2018/06/16 01:25:23 macallan Exp $");
74 74
75#include <sys/param.h> 75#include <sys/param.h>
76#include <sys/systm.h> 76#include <sys/systm.h>
77#include <sys/device.h> 77#include <sys/device.h>
78#include <sys/malloc.h> 78#include <sys/malloc.h>
79#include <sys/bus.h> 79#include <sys/bus.h>
80#include <sys/kernel.h> 80#include <sys/kernel.h>
81#include <sys/lwp.h> 81#include <sys/lwp.h>
82#include <sys/kauth.h> 82#include <sys/kauth.h>
83 83
84#include <dev/wscons/wsdisplayvar.h> 84#include <dev/wscons/wsdisplayvar.h>
85#include <dev/wscons/wsconsio.h> 85#include <dev/wscons/wsconsio.h>
86#include <dev/wsfont/wsfont.h> 86#include <dev/wsfont/wsfont.h>
@@ -2216,27 +2216,31 @@ radeonfb_modeswitch(struct radeonfb_disp @@ -2216,27 +2216,31 @@ radeonfb_modeswitch(struct radeonfb_disp
2216#endif 2216#endif
2217 2217
2218 /* these registers might get in the way... */ 2218 /* these registers might get in the way... */
2219 PUT32(sc, RADEON_OVR_CLR, 0); 2219 PUT32(sc, RADEON_OVR_CLR, 0);
2220 PUT32(sc, RADEON_OVR_WID_LEFT_RIGHT, 0); 2220 PUT32(sc, RADEON_OVR_WID_LEFT_RIGHT, 0);
2221 PUT32(sc, RADEON_OVR_WID_TOP_BOTTOM, 0); 2221 PUT32(sc, RADEON_OVR_WID_TOP_BOTTOM, 0);
2222 PUT32(sc, RADEON_OV0_SCALE_CNTL, 0); 2222 PUT32(sc, RADEON_OV0_SCALE_CNTL, 0);
2223 PUT32(sc, RADEON_SUBPIC_CNTL, 0); 2223 PUT32(sc, RADEON_SUBPIC_CNTL, 0);
2224 PUT32(sc, RADEON_VIPH_CONTROL, 0); 2224 PUT32(sc, RADEON_VIPH_CONTROL, 0);
2225 PUT32(sc, RADEON_I2C_CNTL_1, 0); 2225 PUT32(sc, RADEON_I2C_CNTL_1, 0);
2226 PUT32(sc, RADEON_GEN_INT_CNTL, 0); 2226 PUT32(sc, RADEON_GEN_INT_CNTL, 0);
2227 PUT32(sc, RADEON_CAP0_TRIG_CNTL, 0); 2227 PUT32(sc, RADEON_CAP0_TRIG_CNTL, 0);
2228 PUT32(sc, RADEON_CAP1_TRIG_CNTL, 0); 2228 PUT32(sc, RADEON_CAP1_TRIG_CNTL, 0);
2229 PUT32(sc, RADEON_SURFACE_CNTL, 0); 2229 /*
 2230 * Apple OF hands us R3xx radeons with tiling enabled - explicitly
 2231 * disable it here
 2232 */
 2233 PUT32(sc, RADEON_SURFACE_CNTL, RADEON_SURF_TRANSLATION_DIS);
2230 2234
2231 for (i = 0; i < dp->rd_ncrtcs; i++) 2235 for (i = 0; i < dp->rd_ncrtcs; i++)
2232 radeonfb_setcrtc(dp, i); 2236 radeonfb_setcrtc(dp, i);
2233 2237
2234#if 0 2238#if 0
2235 /* 2239 /*
2236 * DVO chip voodoo from xf86-video-radeon 2240 * DVO chip voodoo from xf86-video-radeon
2237 * apparently this is needed for some powerbooks with DVI outputs 2241 * apparently this is needed for some powerbooks with DVI outputs
2238 */ 2242 */
2239 2243
2240 uint8_t data[5][2] = {{0x8, 0x030}, {0x9, 0}, {0xa, 0x90}, {0xc, 0x89}, {0x8, 0x3b}}; 2244 uint8_t data[5][2] = {{0x8, 0x030}, {0x9, 0}, {0xa, 0x90}, {0xc, 0x89}, {0x8, 0x3b}};
2241 int n = 0; 2245 int n = 0;
2242 iic_acquire_bus(&sc->sc_i2c[0].ric_controller, 0); 2246 iic_acquire_bus(&sc->sc_i2c[0].ric_controller, 0);