diff options
author | Marek Olšák <maraeo@gmail.com> | 2010-01-17 00:57:04 +0100 |
---|---|---|
committer | Corbin Simpson <MostAwesomeDude@gmail.com> | 2010-01-24 23:03:29 -0800 |
commit | b7a002df1e06504ff1ed0dc005c9b10aa4be54f7 (patch) | |
tree | 15e09f144972f590afda130ec13faa2dcaca5e79 /src/gallium/winsys/drm | |
parent | 85059964307c3f10e4a328d82af2bb791a5a4927 (diff) |
r300g,radeong: set tiling flags in libdrm
Diffstat (limited to 'src/gallium/winsys/drm')
-rw-r--r-- | src/gallium/winsys/drm/radeon/core/radeon_buffer.c | 22 | ||||
-rw-r--r-- | src/gallium/winsys/drm/radeon/core/radeon_winsys.h | 6 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c index b020ff38fa..25e1cdcdb6 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c @@ -202,6 +202,26 @@ static void radeon_buffer_unmap(struct pipe_winsys *ws, } } +static void radeon_buffer_set_tiling(struct radeon_winsys *ws, + struct pipe_buffer *buffer, + uint32_t pitch, + boolean microtiled, + boolean macrotiled) +{ + struct radeon_pipe_buffer *radeon_buffer = + (struct radeon_pipe_buffer*)buffer; + uint32_t flags = 0; + + if (microtiled) { + flags |= RADEON_BO_FLAGS_MICRO_TILE; + } + if (macrotiled) { + flags |= RADEON_BO_FLAGS_MACRO_TILE; + } + + radeon_bo_set_tiling(radeon_buffer->bo, flags, pitch); +} + static void radeon_fence_reference(struct pipe_winsys *ws, struct pipe_fence_handle **ptr, struct pipe_fence_handle *pfence) @@ -304,5 +324,7 @@ struct radeon_winsys* radeon_pipe_winsys(int fd) radeon_ws->base.get_name = radeon_get_name; + radeon_ws->buffer_set_tiling = radeon_buffer_set_tiling; + return radeon_ws; } diff --git a/src/gallium/winsys/drm/radeon/core/radeon_winsys.h b/src/gallium/winsys/drm/radeon/core/radeon_winsys.h index 9edc9e038c..864082b99b 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_winsys.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_winsys.h @@ -100,6 +100,12 @@ struct radeon_winsys { void (*flush_cb)(void *), void *data); void (*reset_bos)(struct radeon_winsys *winsys); + + void (*buffer_set_tiling)(struct radeon_winsys* winsys, + struct pipe_buffer* buffer, + uint32_t pitch, + boolean microtiled, + boolean macrotiled); }; #endif |