[openchrome-devel] xf86-video-openchrome: 2 commits - src/via_ums.c
Kevin Brace
kevinbrace at kemper.freedesktop.org
Thu Jan 9 01:35:07 UTC 2020
src/via_ums.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit cdd418fb17ba66a16f4235dad935cad567319fc3
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Wed Jan 8 19:34:39 2020 -0600
Remove Bpp variable from VIARec struct
Obtain bpp (bytes per pixel) from pScrn->bitsPerPixel instead.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/src/via_driver.c b/src/via_driver.c
index 8095a00..c366312 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -1152,8 +1152,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
}
/* Set up screen parameters. */
- pVia->Bpp = pScrn->bitsPerPixel >> 3;
- pVia->Bpl = pScrn->virtualX * pVia->Bpp;
+ pVia->Bpl = pScrn->virtualX * (pScrn->bitsPerPixel >> 3);
/* Set the current mode to the first in the list */
pScrn->currentMode = pScrn->modes;
diff --git a/src/via_driver.h b/src/via_driver.h
index 6da2f59..c7e1fe9 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -189,7 +189,7 @@ typedef struct _twodContext {
} ViaTwodContext;
typedef struct _VIA {
- int Bpp, Bpl;
+ int Bpl;
Bool KMS;
Bool FirstInit;
diff --git a/src/via_ums.c b/src/via_ums.c
index 4993e9f..3a46cc1 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -739,8 +739,9 @@ viaUMSCreate(ScrnInfoPtr pScrn)
"Frame Buffer From (%d,%d) To (%d,%d)\n",
AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2, AvailFBArea.y2));
- offset = (pVia->FBFreeStart + pVia->Bpp - 1) / pVia->Bpp;
- size = pVia->FBFreeEnd / pVia->Bpp - offset;
+ offset = (pVia->FBFreeStart + ((pScrn->bitsPerPixel >> 3) - 1)) /
+ (pScrn->bitsPerPixel >> 3);
+ size = (pVia->FBFreeEnd / (pScrn->bitsPerPixel >> 3)) - offset;
if (size > 0)
xf86InitFBManagerLinear(pScreen, offset, size);
diff --git a/src/via_xvmc.c b/src/via_xvmc.c
index a69c944..56b2602 100644
--- a/src/via_xvmc.c
+++ b/src/via_xvmc.c
@@ -504,7 +504,7 @@ ViaXvMCCreateContext(ScrnInfoPtr pScrn, XvMCContextPtr pContext,
contextRec->chipId = pVia->ChipId;
contextRec->screen = pScrn->scrnIndex;
contextRec->depth = pScrn->bitsPerPixel;
- contextRec->stride = pVia->Bpp * pScrn->virtualX;
+ contextRec->stride = pScrn->virtualX * (pScrn->bitsPerPixel >> 3);
vXvMC->nContexts++;
vXvMC->contexts[ctxNo] = pContext->context_id;
commit f69fe30f6554401930a2fef67aff03eefcd72037
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Wed Jan 8 19:17:12 2020 -0600
Revert commit a138c2d0dd353788b4c9fd5adc82eedbf8429553
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/src/via_driver.c b/src/via_driver.c
index c366312..8095a00 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -1152,7 +1152,8 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
}
/* Set up screen parameters. */
- pVia->Bpl = pScrn->virtualX * (pScrn->bitsPerPixel >> 3);
+ pVia->Bpp = pScrn->bitsPerPixel >> 3;
+ pVia->Bpl = pScrn->virtualX * pVia->Bpp;
/* Set the current mode to the first in the list */
pScrn->currentMode = pScrn->modes;
diff --git a/src/via_driver.h b/src/via_driver.h
index c7e1fe9..6da2f59 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -189,7 +189,7 @@ typedef struct _twodContext {
} ViaTwodContext;
typedef struct _VIA {
- int Bpl;
+ int Bpp, Bpl;
Bool KMS;
Bool FirstInit;
diff --git a/src/via_ums.c b/src/via_ums.c
index 5c595a4..4993e9f 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -739,9 +739,8 @@ viaUMSCreate(ScrnInfoPtr pScrn)
"Frame Buffer From (%d,%d) To (%d,%d)\n",
AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2, AvailFBArea.y2));
- offset = (pVia->FBFreeStart + ((pScrn->bitsPerPixel >> 3) - 1)) /
- (pScrn->bitsPerPixel >> 3);
- size = pVia->FBFreeEnd / ((pScrn->bitsPerPixel >> 3) - offset);
+ offset = (pVia->FBFreeStart + pVia->Bpp - 1) / pVia->Bpp;
+ size = pVia->FBFreeEnd / pVia->Bpp - offset;
if (size > 0)
xf86InitFBManagerLinear(pScreen, offset, size);
diff --git a/src/via_xvmc.c b/src/via_xvmc.c
index 56b2602..a69c944 100644
--- a/src/via_xvmc.c
+++ b/src/via_xvmc.c
@@ -504,7 +504,7 @@ ViaXvMCCreateContext(ScrnInfoPtr pScrn, XvMCContextPtr pContext,
contextRec->chipId = pVia->ChipId;
contextRec->screen = pScrn->scrnIndex;
contextRec->depth = pScrn->bitsPerPixel;
- contextRec->stride = pScrn->virtualX * (pScrn->bitsPerPixel >> 3);
+ contextRec->stride = pVia->Bpp * pScrn->virtualX;
vXvMC->nContexts++;
vXvMC->contexts[ctxNo] = pContext->context_id;
More information about the openchrome-devel
mailing list