mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
crocus: don't map scanout buffers as write-back
This essentially ports6440523077Author: Keith Packard <keithp@keithp.com> Date: Fri Aug 6 16:11:18 2021 -0700 iris: Map scanout buffers WC instead of WB [v2] to crocus. Fixes:f3630548f1("crocus: initial gallium driver for Intel gfx 4-7") Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15313> (cherry picked from commite8c3be0eb8)
This commit is contained in:
parent
41a8a3b0a0
commit
6822ea6304
4 changed files with 17 additions and 1 deletions
|
|
@ -679,7 +679,7 @@
|
|||
"description": "crocus: don't map scanout buffers as write-back",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "f3630548f1da904ec6c63b43ece7e68afdb8867e"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -429,6 +429,9 @@ bo_alloc_internal(struct crocus_bufmgr *bufmgr,
|
|||
bo->index = -1;
|
||||
bo->kflags = 0;
|
||||
|
||||
if (flags & BO_ALLOC_SCANOUT)
|
||||
bo->scanout = 1;
|
||||
|
||||
if ((flags & BO_ALLOC_COHERENT) && !bo->cache_coherent) {
|
||||
struct drm_i915_gem_caching arg = {
|
||||
.handle = bo->gem_handle,
|
||||
|
|
@ -1010,6 +1013,9 @@ crocus_bo_map_gtt(struct pipe_debug_callback *dbg,
|
|||
static bool
|
||||
can_map_cpu(struct crocus_bo *bo, unsigned flags)
|
||||
{
|
||||
if (bo->scanout)
|
||||
return false;
|
||||
|
||||
if (bo->cache_coherent)
|
||||
return true;
|
||||
|
||||
|
|
|
|||
|
|
@ -141,12 +141,18 @@ struct crocus_bo {
|
|||
*/
|
||||
bool userptr;
|
||||
|
||||
/**
|
||||
* Boolean of if this is used for scanout.
|
||||
*/
|
||||
bool scanout;
|
||||
|
||||
/** Pre-computed hash using _mesa_hash_pointer for cache tracking sets */
|
||||
uint32_t hash;
|
||||
};
|
||||
|
||||
#define BO_ALLOC_ZEROED (1 << 0)
|
||||
#define BO_ALLOC_COHERENT (1 << 1)
|
||||
#define BO_ALLOC_SCANOUT (1 << 2)
|
||||
|
||||
/**
|
||||
* Allocate a buffer object.
|
||||
|
|
|
|||
|
|
@ -708,6 +708,10 @@ crocus_resource_create_with_modifiers(struct pipe_screen *pscreen,
|
|||
if (templ->usage == PIPE_USAGE_STAGING)
|
||||
flags |= BO_ALLOC_COHERENT;
|
||||
|
||||
/* Scanout buffers need to be WC. */
|
||||
if (templ->bind & PIPE_BIND_SCANOUT)
|
||||
flags |= BO_ALLOC_SCANOUT;
|
||||
|
||||
uint64_t aux_size = 0;
|
||||
uint32_t aux_preferred_alloc_flags;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue