From 16417a66148e7134db119c9da3b0a48834409529 Mon Sep 17 00:00:00 2001 From: deadwood Date: Sun, 8 Jan 2017 13:06:53 +0000 Subject: [PATCH] x11gfx.hidd: support 32 bit modes For example Odroid XU4 reports these depths when running a 3D based driver. Our graphics system was in such case falling back to 24 bit depths, which was causing error with XPutImage as the temporary XImage object was 24 bits in depth. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@53184 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- arch/all-hosted/hidd/x11/x11gfx.conf | 2 +- arch/all-hosted/hidd/x11/x11gfx_hiddclass.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/all-hosted/hidd/x11/x11gfx.conf b/arch/all-hosted/hidd/x11/x11gfx.conf index 0267960ee4..eafea01bdb 100644 --- a/arch/all-hosted/hidd/x11/x11gfx.conf +++ b/arch/all-hosted/hidd/x11/x11gfx.conf @@ -2,7 +2,7 @@ basename X11Cl libbase X11ClBase libbasetype struct x11clbase -version 42.3 +version 42.4 residentpri 9 classid CLID_Hidd_Gfx_X11 superclass CLID_Hidd_Gfx diff --git a/arch/all-hosted/hidd/x11/x11gfx_hiddclass.c b/arch/all-hosted/hidd/x11/x11gfx_hiddclass.c index c4baa579c5..9cdef10bf7 100644 --- a/arch/all-hosted/hidd/x11/x11gfx_hiddclass.c +++ b/arch/all-hosted/hidd/x11/x11gfx_hiddclass.c @@ -51,6 +51,7 @@ static const struct OOP_ABDescr attrbases[] = static VOID cleanupx11stuff(struct x11_staticdata *xsd); static BOOL initx11stuff(struct x11_staticdata *xsd); +static ULONG mask_to_shift(ULONG mask); /****************************************************************************************/ @@ -354,7 +355,15 @@ OOP_Object *X11Cl__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg pftags[5].ti_Data = XSD(cl)->vi->green_mask; pftags[6].ti_Data = XSD(cl)->vi->blue_mask; pftags[7].ti_Data = 0x00000000; - + + /* Support 32-bit modes (ie. odroid XU4 with 3D driver) */ + if (XSD(cl)->depth > 24) + { + pftags[7].ti_Data = 0xFFFFFFFF ^ (XSD(cl)->vi->red_mask + | XSD(cl)->vi->green_mask | XSD(cl)->vi->blue_mask); + pftags[3].ti_Data = mask_to_shift(pftags[7].ti_Data); + } + if (XSD(cl)->vi->class == TrueColor) { pftags[8].ti_Data = vHidd_ColorModel_TrueColor; -- 2.11.4.GIT