commit 0da359a9e140539b87335b74e313166b74627018
parent b4e902bbecb678c45485b52c3aa183cbc932c595
Author: Michael Forney <mforney@mforney.org>
Date: Mon, 18 Mar 2019 20:33:02 -0700
intel: Don't tile cursor buffer, regardless of size
The right way to choose a kernel buffer size is to query
DRM_CAP_CURSOR_WIDTH and DRM_CAP_CURSOR_HEIGHT. However, on intel
this may return 256, the maximum size. Make sure not to tile the
cursor buffer, even if we'd tile it otherwise.
Diffstat:
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/intel.c b/intel.c
@@ -155,7 +155,7 @@ struct buffer * context_create_buffer(struct wld_context * base,
struct intel_context * context = intel_context(base);
struct buffer * buffer;
drm_intel_bo * bo;
- uint32_t tiling_mode = width >= 128 ? I915_TILING_X : I915_TILING_NONE;
+ uint32_t tiling_mode = width >= 128 && !(flags & WLD_FLAG_CURSOR) ? I915_TILING_X : I915_TILING_NONE;
unsigned long pitch;
bo = drm_intel_bo_alloc_tiled(context->bufmgr, "buffer", width, height, 4,
diff --git a/wld.h b/wld.h
@@ -49,7 +49,8 @@ enum wld_format
enum wld_flags
{
- WLD_FLAG_MAP = 0x1 << 16
+ WLD_FLAG_MAP = 1 << 16,
+ WLD_FLAG_CURSOR = 1 << 17,
};
bool wld_lookup_named_color(const char * name, uint32_t * color);