From 481a3926342a9b890470f9af4fdcfd2435f28061 Mon Sep 17 00:00:00 2001 From: neil Date: Wed, 18 May 2011 08:48:08 +0000 Subject: [PATCH] Determine chip differences more precisely. Makes a few more chips work. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@38732 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/devs/monitors/IntelGMA/intelG45_bitmap.c | 17 ++++-- workbench/devs/monitors/IntelGMA/intelG45_init.c | 66 +++++++++++++++++++--- 2 files changed, 71 insertions(+), 12 deletions(-) diff --git a/workbench/devs/monitors/IntelGMA/intelG45_bitmap.c b/workbench/devs/monitors/IntelGMA/intelG45_bitmap.c index b9c387cbec..2e2e85b62f 100644 --- a/workbench/devs/monitors/IntelGMA/intelG45_bitmap.c +++ b/workbench/devs/monitors/IntelGMA/intelG45_bitmap.c @@ -54,6 +54,12 @@ struct pRoot_Dispose { OOP_MethodID mID; }; +static BOOL CanAccelerateBlits(UWORD product_id) +{ + return product_id >= 0x2582 + && product_id <= 0x27ae; +} + OOP_Object *METHOD(GMABM, Root, New) { EnterFunc(bug("[GMABitMap] Bitmap::New()\n")); @@ -114,7 +120,8 @@ OOP_Object *METHOD(GMABM, Root, New) if (displayable) bm->displayable = TRUE; else bm->displayable = FALSE; //bm->compositing = sd->compositing; - bm->compositing = (OOP_Object *)GetTagData(aHidd_BitMap_IntelG45_CompositingHidd, 0, msg->attrList); + bm->compositing = (OOP_Object *) + GetTagData(aHidd_BitMap_IntelG45_CompositingHidd, 0, msg->attrList); /* FIXME: check if compositing hidd was passed */ if (displayable) @@ -1259,7 +1266,7 @@ VOID METHOD(GMABM, Hidd_BitMap, PutImage) * draw (many blits of height=1 instead of one single blit). * Therefore, many many the cache flushes kill the expected performance significantly. */ - if (sd->ProductID < 0x2800 && bm->fbgfx && bm->bpp == 4 + if (CanAccelerateBlits(sd->ProductID) && bm->fbgfx && bm->bpp == 4 && (msg->pixFmt == vHidd_StdPixFmt_Native || msg->pixFmt == vHidd_StdPixFmt_Native32 || msg->pixFmt == vHidd_StdPixFmt_BGRA32 @@ -1476,7 +1483,7 @@ VOID METHOD(GMABM, Hidd_BitMap, PutImage) break; default: - if (sd->ProductID < 0x2800 && bm->bpp == 4) + if (CanAccelerateBlits(sd->ProductID) && bm->bpp == 4) { /* Get image width aligned to 4K page boundary */ uint32_t line_width = (msg->width * bm->bpp + 4095) & ~4095; @@ -1619,7 +1626,7 @@ VOID METHOD(GMABM, Hidd_BitMap, PutImageLUT) { LOCK_HW - if (bm->bpp == 4 && sd->ProductID < 0x2800) + if (bm->bpp == 4 && CanAccelerateBlits(sd->ProductID)) { /* Get two buffers in different GTT regions and _surely_ in different CPU cache lines */ uint32_t *buffer_1 = (uint32_t *)(((intptr_t)pages + 4095) & ~4095); @@ -1745,7 +1752,7 @@ VOID METHOD(GMABM, Hidd_BitMap, GetImage) DO_FLUSH(); UNLOCK_HW - if (bm->bpp == 4 && sd->ProductID < 0x2800 + if (bm->bpp == 4 && CanAccelerateBlits(sd->ProductID) && (msg->pixFmt == vHidd_StdPixFmt_Native || msg->pixFmt == vHidd_StdPixFmt_Native32)) { diff --git a/workbench/devs/monitors/IntelGMA/intelG45_init.c b/workbench/devs/monitors/IntelGMA/intelG45_init.c index 5567cf7254..c0d3e12bf6 100644 --- a/workbench/devs/monitors/IntelGMA/intelG45_init.c +++ b/workbench/devs/monitors/IntelGMA/intelG45_init.c @@ -44,13 +44,65 @@ static const char __attribute__((used)) __greet[] = "!!! This driver is sponsore static BOOL IsCompatible(UWORD product_id) { - return product_id == 0x2582 + return +// || product_id == 0x0042 +// || product_id == 0x0046 +// || product_id == 0x0102 +// || product_id == 0x0106 +// || product_id == 0x010a +// || product_id == 0x0112 +// || product_id == 0x0116 +// || product_id == 0x0122 +// || product_id == 0x0126 +// || product_id == 0x2562 +// || product_id == 0x2572 + product_id == 0x2582 + || product_id == 0x258a + || product_id == 0x2592 || product_id == 0x2772 || product_id == 0x27a2 - || product_id == 0x27a6 || product_id == 0x27ae +// || product_id == 0x2972 +// || product_id == 0x2982 +// || product_id == 0x2992 +// || product_id == 0x29a2 +// || product_id == 0x29b2 +// || product_id == 0x29c2 +// || product_id == 0x29d2 || product_id == 0x2a02 - || product_id == 0x2a42; + || product_id == 0x2a12 + || product_id == 0x2a42 + || product_id == 0x2e02 + || product_id == 0x2e12 + || product_id == 0x2e22 + || product_id == 0x2e32 + || product_id == 0x2e42 + || product_id == 0x2e92 +// || product_id == 0x3577 +// || product_id == 0x3582 +// || product_id == 0x358e +// || product_id == 0xa001 +// || product_id == 0xa011 + ; +} + +static BOOL NeedsPhysicalCursor(UWORD product_id) +{ + /* TRUE if one of i830, i85x, i915G(M), i945G(M) */ + return product_id == 0x258a + || product_id == 0x2592 + || product_id == 0x2772 + || product_id == 0x27a2 + || product_id == 0x27ae + || product_id == 0x3577 + || product_id == 0x3582 + || product_id == 0x358e; +} + +static BOOL HasQuadBARs(UWORD product_id) +{ + return product_id > 0x2800 + && product_id < 0xa000; } static ULONG GetGATTSize(struct g45staticdata *sd) @@ -230,7 +282,7 @@ AROS_UFH3(void, Enumerator, OOP_SetAttrs(pciDevice, attrs); OOP_GetAttr(pciDevice, aHidd_PCIDevice_Driver, (IPTR *)&driver); - if (ProductID >= 0x2800) + if (HasQuadBARs(ProductID)) { OOP_GetAttr(pciDevice, aHidd_PCIDevice_Base0, &mmio_base); OOP_GetAttr(pciDevice, aHidd_PCIDevice_Base2, &window_base); @@ -372,10 +424,10 @@ AROS_UFH3(void, Enumerator, /* Reserve some memory for HW cursor */ sd->CursorImage = ((intptr_t)Allocate(&sd->CardMem, 64*64*4)) - (intptr_t)sd->Card.Framebuffer; - if (ProductID >= 0x2800) - sd->CursorBase = sd->CursorImage; - else + if (NeedsPhysicalCursor(ProductID)) sd->CursorBase = G45_VirtualToPhysical(sd, sd->CursorImage); + else + sd->CursorBase = sd->CursorImage; D(bug("[GMA] Using ARGB cursor at graphics address %08x (physical address %08x)\n", sd->CursorImage, sd->CursorBase)); -- 2.11.4.GIT