summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Brace <kevinbrace@gmx.com>2020-03-23 14:24:22 -0700
committerKevin Brace <kevinbrace@gmx.com>2020-03-23 14:24:31 -0700
commit5830d5d781f1303062bd9b093772f613bcf0b014 (patch)
tree389d2a8c2e5c906297008f9f67ee3a659c754d2c
parenteb7ba2f926dd55fb994f23328efa1e735aeba2fb (diff)
Really pass the alignment requirement when allocating memory
In UMS no acceleration and non-DRI1 EXA acceleration situations, drm_bo_alloc() was not actually passing the alignment requirement to function calls that allocate memory. They were blindly specifying 32 byte alignment. Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
-rw-r--r--src/via_memmgr.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/via_memmgr.c b/src/via_memmgr.c
index d063399..264eca0 100644
--- a/src/via_memmgr.c
+++ b/src/via_memmgr.c
@@ -44,15 +44,18 @@
static int
viaOffScreenLinear(ScrnInfoPtr pScrn, struct buffer_object *obj,
- unsigned long size)
+ unsigned long size, unsigned long alignment)
{
FBLinearPtr linear;
int depth = pScrn->bitsPerPixel / 8;
+ int newAlignment;
int ret = 0;
+ newAlignment = alignment;
linear = xf86AllocateOffscreenLinear(pScrn->pScreen,
- (size + depth - 1) / depth,
- 32, NULL, NULL, NULL);
+ (size + depth - 1) / depth,
+ newAlignment,
+ NULL, NULL, NULL);
if (!linear) {
ret = -ENOMEM;
goto exit;
@@ -69,14 +72,16 @@ exit:
static int
viaEXAOffscreenAlloc(ScrnInfoPtr pScrn, struct buffer_object *obj,
- unsigned long size)
+ unsigned long size, unsigned long alignment)
{
ExaOffscreenArea *pArea;
int newSize = size;
+ int newAlignment;
int ret = 0;
+ newAlignment = alignment;
pArea = exaOffscreenAlloc(pScrn->pScreen, newSize,
- 32, TRUE, NULL, NULL);
+ newAlignment, TRUE, NULL, NULL);
if (!pArea) {
ret = -ENOMEM;
goto exit;
@@ -112,7 +117,8 @@ drm_bo_alloc(ScrnInfoPtr pScrn, unsigned long size,
case TTM_PL_FLAG_VRAM:
if (pVia->directRenderingType == DRI_NONE) {
if (!pVia->useEXA) {
- ret = viaOffScreenLinear(pScrn, obj, size);
+ ret = viaOffScreenLinear(pScrn, obj,
+ size, alignment);
if (ret) {
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Linear memory allocation "
@@ -126,7 +132,8 @@ drm_bo_alloc(ScrnInfoPtr pScrn, unsigned long size,
obj->handle));
}
} else {
- ret = viaEXAOffscreenAlloc(pScrn, obj, size);
+ ret = viaEXAOffscreenAlloc(pScrn, obj,
+ size, alignment);
if (ret) {
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"EXA offscreen memory "