/* one ref already taken */
tex->buffer = buffer;
+ rws->buffer_get_tiling(rws, buffer, &tex->microtile, &tex->macrotile);
return (struct pipe_texture*)tex;
}
void (*reset_bos)(struct r300_winsys_screen *winsys);
+ void (*buffer_get_tiling)(struct r300_winsys_screen *winsys,
+ struct r300_winsys_buffer *buffer,
+ enum r300_buffer_tiling *microtiled,
+ enum r300_buffer_tiling *macrotiled);
+
void (*buffer_set_tiling)(struct r300_winsys_screen *winsys,
struct r300_winsys_buffer *buffer,
uint32_t pitch,
struct pb_buffer *radeon_drm_bufmgr_create_buffer_from_handle(struct pb_manager *_mgr,
uint32_t handle);
+void radeon_drm_bufmgr_get_tiling(struct pb_buffer *_buf,
+ enum r300_buffer_tiling *microtiled,
+ enum r300_buffer_tiling *macrotiled);
+
void radeon_drm_bufmgr_set_tiling(struct pb_buffer *_buf,
enum r300_buffer_tiling microtiled,
enum r300_buffer_tiling macrotiled,
}
return TRUE;
}
-
+
+void radeon_drm_bufmgr_get_tiling(struct pb_buffer *_buf,
+ enum r300_buffer_tiling *microtiled,
+ enum r300_buffer_tiling *macrotiled)
+{
+ struct radeon_drm_buffer *buf = get_drm_buffer(_buf);
+ uint32_t flags = 0, pitch;
+
+ radeon_bo_get_tiling(buf->bo, &flags, &pitch);
+
+ *microtiled = R300_BUFFER_LINEAR;
+ *macrotiled = R300_BUFFER_LINEAR;
+ if (flags & RADEON_BO_FLAGS_MICRO_TILE)
+ *microtiled = R300_BUFFER_TILED;
+
+ if (flags & RADEON_BO_FLAGS_MACRO_TILE)
+ *macrotiled = R300_BUFFER_TILED;
+}
void radeon_drm_bufmgr_set_tiling(struct pb_buffer *_buf,
enum r300_buffer_tiling microtiled,
radeon_drm_bufmgr_set_tiling(_buf, microtiled, macrotiled, pitch);
}
+static void radeon_r300_winsys_buffer_get_tiling(struct r300_winsys_screen *rws,
+ struct r300_winsys_buffer *buf,
+ enum r300_buffer_tiling *microtiled,
+ enum r300_buffer_tiling *macrotiled)
+{
+ struct pb_buffer *_buf = radeon_pb_buffer(buf);
+ radeon_drm_bufmgr_get_tiling(_buf, microtiled, macrotiled);
+}
+
static void *radeon_r300_winsys_buffer_map(struct r300_winsys_screen *ws,
struct r300_winsys_buffer *buf,
unsigned usage)
ws->base.buffer_create = radeon_r300_winsys_buffer_create;
ws->base.buffer_destroy = radeon_r300_winsys_buffer_destroy;
ws->base.buffer_set_tiling = radeon_r300_winsys_buffer_set_tiling;
+ ws->base.buffer_get_tiling = radeon_r300_winsys_buffer_get_tiling;
ws->base.buffer_map = radeon_r300_winsys_buffer_map;
ws->base.buffer_unmap = radeon_r300_winsys_buffer_unmap;
ws->base.buffer_reference = radeon_r300_winsys_buffer_reference;