summaryrefslogtreecommitdiff
path: root/packaging/u_cirrus-virt-16bpp.patch
blob: 11ea3e5ba3160f50c03a29bde9db858804049b0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff -up xf86-video-cirrus-1.3.2/src/alp_driver.c.jx xf86-video-cirrus-1.3.2/src/alp_driver.c
--- xf86-video-cirrus-1.3.2/src/alp_driver.c.jx	2012-04-02 16:30:29.000000000 -0400
+++ xf86-video-cirrus-1.3.2/src/alp_driver.c	2012-04-02 16:33:11.668580522 -0400
@@ -476,6 +476,7 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
 	vgaHWPtr hwp;
 	MessageType from, from1;
 	int i;
+	int defaultdepth;
 	int depth_flags;
 	ClockRangePtr clockRanges;
 	char *s;
@@ -557,11 +558,18 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
 	    depth_flags |= Support32bppFb |
 			   SupportConvert32to24 |
 			   PreferConvert32to24;
+
+	/* use 16bpp in virt */
+	if ((pCir->PciInfo->subvendor_id & 0xffff) == 0x1af4)
+	    defaultdepth = 16;
+	else
+	    defaultdepth = 24;
+
 	/*
 	 * The first thing we should figure out is the depth, bpp, etc.
 	 * We support both 24bpp and 32bpp layouts, so indicate that.
 	 */
-	if (!xf86SetDepthBpp(pScrn, 0, 0, 24, depth_flags)) {
+	if (!xf86SetDepthBpp(pScrn, 0, 0, defaultdepth, depth_flags)) {
 		return FALSE;
 	} else {
 		/* Check that the returned depth is one we support */