mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-20 18:40:09 +01:00
intel: Sanitise strides for linear buffers and SET_TILING
Ensure that the user doesn't attempt to specify a stride to use with a linear buffer by forcing such to be zero. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
13e8270504
commit
cd34cbeb9f
1 changed files with 6 additions and 0 deletions
|
|
@ -1735,6 +1735,12 @@ drm_intel_gem_bo_set_tiling(drm_intel_bo *bo, uint32_t * tiling_mode,
|
||||||
if (bo_gem->global_name == 0)
|
if (bo_gem->global_name == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
/* Linear buffers have no stride. By ensuring that we only ever use
|
||||||
|
* stride 0 with linear buffers, we simplify our code.
|
||||||
|
*/
|
||||||
|
if (*tiling_mode === I915_TILING_NONE)
|
||||||
|
stride = 0;
|
||||||
|
|
||||||
ret = drm_intel_gem_bo_set_tiling_internal(bo, *tiling_mode, stride);
|
ret = drm_intel_gem_bo_set_tiling_internal(bo, *tiling_mode, stride);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
drm_intel_bo_gem_set_in_aperture_size(bufmgr_gem, bo_gem);
|
drm_intel_bo_gem_set_in_aperture_size(bufmgr_gem, bo_gem);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue