Lines 173-179
Link Here
|
173 |
struct intel_region * |
173 |
struct intel_region * |
174 |
intel_region_alloc(struct intel_context *intel, |
174 |
intel_region_alloc(struct intel_context *intel, |
175 |
uint32_t tiling, |
175 |
uint32_t tiling, |
176 |
GLuint cpp, GLuint width, GLuint height, GLuint pitch, |
176 |
GLuint cpp, GLuint width, GLuint height, |
177 |
GLboolean expect_accelerated_upload) |
177 |
GLboolean expect_accelerated_upload) |
178 |
{ |
178 |
{ |
179 |
dri_bo *buffer; |
179 |
dri_bo *buffer; |
Lines 187-203
Link Here
|
187 |
buffer = drm_intel_bo_alloc_tiled(intel->bufmgr, "region", |
187 |
buffer = drm_intel_bo_alloc_tiled(intel->bufmgr, "region", |
188 |
width, height, cpp, |
188 |
width, height, cpp, |
189 |
&tiling, &aligned_pitch, flags); |
189 |
&tiling, &aligned_pitch, flags); |
190 |
/* We've already chosen a pitch as part of miptree layout. It had |
|
|
191 |
* better be the same. |
192 |
*/ |
193 |
assert(aligned_pitch == pitch * cpp); |
194 |
|
190 |
|
195 |
region = intel_region_alloc_internal(intel, cpp, width, height, |
191 |
region = intel_region_alloc_internal(intel, cpp, width, height, |
196 |
pitch, buffer); |
192 |
aligned_pitch / cpp, buffer); |
197 |
|
193 |
|
198 |
if (tiling != I915_TILING_NONE) { |
194 |
if (tiling != I915_TILING_NONE) { |
199 |
assert(((pitch * cpp) & 127) == 0); |
195 |
assert((aligned_pitch & 127) == 0); |
200 |
drm_intel_bo_set_tiling(buffer, &tiling, pitch * cpp); |
196 |
drm_intel_bo_set_tiling(buffer, &tiling, aligned_pitch); |
201 |
drm_intel_bo_get_tiling(buffer, ®ion->tiling, ®ion->bit_6_swizzle); |
197 |
drm_intel_bo_get_tiling(buffer, ®ion->tiling, ®ion->bit_6_swizzle); |
202 |
} |
198 |
} |