#include "pipe/p_screen.h"
-/* XXX NO! just no! */
-#include "state_tracker/drm_driver.h"
-
enum r300_dim {
DIM_WIDTH = 0,
DIM_HEIGHT = 1
return FALSE;
}
- whandle->stride = r300_texture_get_stride(r300_screen(screen), tex, 0);
-
- return rws->buffer_get_handle(rws, tex->buffer, whandle);
+ return rws->buffer_get_handle(rws, tex->buffer, whandle,
+ r300_texture_get_stride(r300_screen(screen), tex, 0));
}
struct u_resource_vtbl r300_texture_vtbl =
struct r300_screen* rscreen = r300_screen(screen);
struct r300_winsys_buffer *buffer;
struct r300_texture* tex;
+ unsigned stride;
boolean override_zb_flags;
/* Support only 2D textures without mipmaps */
return NULL;
}
- /* XXX make the winsys return the stride_override, see i915_resource_texture.c:830 */
- buffer = rws->buffer_from_handle(rws, whandle->handle);
+ buffer = rws->buffer_from_handle(rws, whandle, &stride);
if (!buffer) {
return NULL;
}
tex->b.b.screen = screen;
tex->domain = R300_DOMAIN_VRAM;
- tex->stride_override = whandle->stride;
+ tex->stride_override = stride;
/* one ref already taken */
tex->buffer = buffer;
"Pitch: % 4i, Dim: %ix%i, Format: %s\n",
tex->macrotile ? "YES" : " NO",
tex->microtile ? "YES" : " NO",
- whandle->stride / util_format_get_blocksize(base->format),
+ stride / util_format_get_blocksize(base->format),
base->width0, base->height0,
util_format_short_name(base->format));
enum r300_value_id vid);
struct r300_winsys_buffer *(*buffer_from_handle)(struct r300_winsys_screen *winsys,
- unsigned handle);
+ struct winsys_handle *whandle,
+ unsigned *stride);
boolean (*buffer_get_handle)(struct r300_winsys_screen *winsys,
struct r300_winsys_buffer *buffer,
- struct winsys_handle *whandle);
+ struct winsys_handle *whandle,
+ unsigned stride);
boolean (*is_buffer_referenced)(struct r300_winsys_screen *winsys,
struct r300_winsys_buffer *buffer,
}
static struct r300_winsys_buffer *radeon_r300_winsys_buffer_from_handle(struct r300_winsys_screen *rws,
- unsigned handle)
+ struct winsys_handle *whandle,
+ unsigned *stride)
{
struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws);
struct pb_buffer *_buf;
- _buf = radeon_drm_bufmgr_create_buffer_from_handle(ws->kman, handle);
+ *stride = whandle->stride;
+
+ _buf = radeon_drm_bufmgr_create_buffer_from_handle(ws->kman, whandle->handle);
return radeon_libdrm_winsys_buffer(_buf);
}
static boolean radeon_r300_winsys_buffer_get_handle(struct r300_winsys_screen *rws,
struct r300_winsys_buffer *buffer,
- struct winsys_handle *whandle)
+ struct winsys_handle *whandle,
+ unsigned stride)
{
struct pb_buffer *_buf = radeon_pb_buffer(buffer);
+ whandle->stride = stride;
return radeon_drm_bufmgr_get_handle(_buf, whandle);
}