mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 13:18:04 +02:00
nouveau/nvc0: fix linear buffer alignment for scan-out/cursors
The hardware can only scan-out linear buffers with a pitch
aligned to 256. It can only use packed buffers for cursors.
Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/36
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8500>
(cherry picked from commit 6650c53e64)
This commit is contained in:
parent
6a526efcfb
commit
0a1f910f71
2 changed files with 15 additions and 5 deletions
|
|
@ -1948,7 +1948,7 @@
|
|||
"description": "nouveau/nvc0: fix linear buffer alignment for scan-out/cursors",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -377,6 +377,7 @@ nvc0_miptree_create(struct pipe_screen *pscreen,
|
|||
int ret;
|
||||
union nouveau_bo_config bo_config;
|
||||
uint32_t bo_flags;
|
||||
unsigned pitch_align;
|
||||
|
||||
if (!mt)
|
||||
return NULL;
|
||||
|
|
@ -421,10 +422,19 @@ nvc0_miptree_create(struct pipe_screen *pscreen,
|
|||
} else
|
||||
if (likely(bo_config.nvc0.memtype)) {
|
||||
nvc0_miptree_init_layout_tiled(mt);
|
||||
} else
|
||||
if (!nv50_miptree_init_layout_linear(mt, 128)) {
|
||||
FREE(mt);
|
||||
return NULL;
|
||||
} else {
|
||||
/* When modifiers are supplied, usage is zero. TODO: detect the
|
||||
* modifiers+cursor case. */
|
||||
if (pt->usage & PIPE_BIND_CURSOR)
|
||||
pitch_align = 1;
|
||||
else if ((pt->usage & PIPE_BIND_SCANOUT) || count > 0)
|
||||
pitch_align = 256;
|
||||
else
|
||||
pitch_align = 128;
|
||||
if (!nv50_miptree_init_layout_linear(mt, pitch_align)) {
|
||||
FREE(mt);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
bo_config.nvc0.tile_mode = mt->level[0].tile_mode;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue