summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Crozat <fcrozat@suse.com>2016-04-26 13:57:52 +0200
committerAdam Jackson <ajax@redhat.com>2016-04-27 11:59:04 -0400
commit82db44fe8a726a4a1192b1b93992b642d0ec17b3 (patch)
tree1ad4ad2463058fa130c0211f788db849d3d51809
parent23da6073369ef6a99d1789de967e57359d1fe3b0 (diff)
Use 16bpp when running in virt and on XenSource gfx
Due to graphics corruption default to 16bpp in virt instead of 24 (Fedora). Do the same on XenSource gfx, which suffers from the same issue. Reviewed-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--src/alp_driver.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/alp_driver.c b/src/alp_driver.c
index ba55247..01e05dc 100644
--- a/src/alp_driver.c
+++ b/src/alp_driver.c
@@ -466,6 +466,7 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
vgaHWPtr hwp;
MessageType from, from1;
int i;
+ int defaultdepth;
int depth_flags;
ClockRangePtr clockRanges;
char *s;
@@ -551,11 +552,23 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
depth_flags |= Support32bppFb |
SupportConvert32to24 |
PreferConvert32to24;
+
+ /* use 16bpp in virt and on XenSource */
+ #ifndef PCI_CHIP_QEMU
+ #define PCI_CHIP_QEMU 0x1af4
+ #endif
+ #define PCI_CHIP_XENSOURCE 0x5853
+ if (((pCir->PciInfo->subvendor_id & 0xffff) == PCI_CHIP_QEMU) ||
+ ((pCir->PciInfo->subvendor_id & 0xffff) == PCI_CHIP_XENSOURCE))
+ 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 */