Commit 1b02e1ee authored by Keith Whitwell's avatar Keith Whitwell

st/xorg: update for pipe_resources

parent eb39977f
......@@ -62,7 +62,7 @@ struct crtc_private
drmModeCrtcPtr drm_crtc;
/* hwcursor */
struct pipe_texture *cursor_tex;
struct pipe_resource *cursor_tex;
struct kms_bo *cursor_bo;
unsigned cursor_handle;
......@@ -197,7 +197,7 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image)
struct pipe_transfer *transfer;
if (!crtcp->cursor_tex) {
struct pipe_texture templat;
struct pipe_resource templat;
struct winsys_handle whandle;
memset(&templat, 0, sizeof(templat));
......@@ -213,14 +213,14 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image)
memset(&whandle, 0, sizeof(whandle));
whandle.type = DRM_API_HANDLE_TYPE_KMS;
crtcp->cursor_tex = ms->screen->texture_create(ms->screen,
crtcp->cursor_tex = ms->screen->resource_create(ms->screen,
&templat);
ms->screen->texture_get_handle(ms->screen, crtcp->cursor_tex, &whandle);
ms->screen->resource_get_handle(ms->screen, crtcp->cursor_tex, &whandle);
crtcp->cursor_handle = whandle.handle;
}
transfer = ms->ctx->get_transfer(ms->ctx, crtcp->cursor_tex,
transfer = pipe_get_transfer(ms->ctx, crtcp->cursor_tex,
0, 0, 0,
PIPE_TRANSFER_WRITE,
0, 0, 64, 64);
......@@ -229,7 +229,7 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image)
transfer->stride, 0, 0,
64, 64, (void*)image, 64 * 4, 0, 0);
ms->ctx->transfer_unmap(ms->ctx, transfer);
ms->ctx->tex_transfer_destroy(ms->ctx, transfer);
ms->ctx->transfer_destroy(ms->ctx, transfer);
}
#if HAVE_LIBKMS
......@@ -329,7 +329,7 @@ xorg_crtc_cursor_destroy(xf86CrtcPtr crtc)
struct crtc_private *crtcp = crtc->driver_private;
if (crtcp->cursor_tex)
pipe_texture_reference(&crtcp->cursor_tex, NULL);
pipe_resource_reference(&crtcp->cursor_tex, NULL);
#ifdef HAVE_LIBKMS
if (crtcp->cursor_bo)
kms_bo_destroy(&crtcp->cursor_bo);
......
......@@ -53,14 +53,14 @@ static Bool set_format_in_do_create_buffer;
typedef struct {
PixmapPtr pPixmap;
struct pipe_texture *tex;
struct pipe_resource *tex;
struct pipe_fence_handle *fence;
} *BufferPrivatePtr;
static Bool
dri2_do_create_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int format)
{
struct pipe_texture *tex = NULL;
struct pipe_resource *tex = NULL;
ScreenPtr pScreen = pDraw->pScreen;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
modesettingPtr ms = modesettingPTR(pScrn);
......@@ -101,9 +101,9 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int form
/* Fall through */
case DRI2BufferDepth:
if (exa_priv->depth_stencil_tex)
pipe_texture_reference(&tex, exa_priv->depth_stencil_tex);
pipe_resource_reference(&tex, exa_priv->depth_stencil_tex);
else {
struct pipe_texture template;
struct pipe_resource template;
unsigned depthBits = (format != 0) ? format : pDraw->depth;
memset(&template, 0, sizeof(template));
template.target = PIPE_TEXTURE_2D;
......@@ -130,8 +130,8 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int form
template.last_level = 0;
template.tex_usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL |
PIPE_TEXTURE_USAGE_SHARED;
tex = ms->screen->texture_create(ms->screen, &template);
pipe_texture_reference(&exa_priv->depth_stencil_tex, tex);
tex = ms->screen->resource_create(ms->screen, &template);
pipe_resource_reference(&exa_priv->depth_stencil_tex, tex);
}
break;
}
......@@ -157,7 +157,7 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int form
memset(&whandle, 0, sizeof(whandle));
whandle.type = DRM_API_HANDLE_TYPE_SHARED;
ms->screen->texture_get_handle(ms->screen, tex, &whandle);
ms->screen->resource_get_handle(ms->screen, tex, &whandle);
buffer->name = whandle.handle;
buffer->pitch = whandle.stride;
......@@ -185,9 +185,9 @@ dri2_do_destroy_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer)
BufferPrivatePtr private = buffer->driverPrivate;
struct exa_pixmap_priv *exa_priv = exaGetPixmapDriverPrivate(private->pPixmap);
pipe_texture_reference(&private->tex, NULL);
pipe_resource_reference(&private->tex, NULL);
ms->screen->fence_reference(ms->screen, &private->fence, NULL);
pipe_texture_reference(&exa_priv->depth_stencil_tex, NULL);
pipe_resource_reference(&exa_priv->depth_stencil_tex, NULL);
(*pScreen->DestroyPixmap)(private->pPixmap);
}
......
......@@ -986,7 +986,7 @@ drv_destroy_front_buffer_ga3d(ScrnInfoPtr pScrn)
ms->fb_id = -1;
}
pipe_texture_reference(&ms->root_texture, NULL);
pipe_resource_reference(&ms->root_texture, NULL);
return TRUE;
}
......@@ -994,7 +994,7 @@ static Bool
drv_create_front_buffer_ga3d(ScrnInfoPtr pScrn)
{
modesettingPtr ms = modesettingPTR(pScrn);
struct pipe_texture *tex;
struct pipe_resource *tex;
struct winsys_handle whandle;
unsigned fb_id;
int ret;
......@@ -1010,7 +1010,7 @@ drv_create_front_buffer_ga3d(ScrnInfoPtr pScrn)
memset(&whandle, 0, sizeof(whandle));
whandle.type = DRM_API_HANDLE_TYPE_KMS;
if (!ms->screen->texture_get_handle(ms->screen, tex, &whandle))
if (!ms->screen->resource_get_handle(ms->screen, tex, &whandle))
goto err_destroy;
ret = drmModeAddFB(ms->fd,
......@@ -1034,14 +1034,14 @@ drv_create_front_buffer_ga3d(ScrnInfoPtr pScrn)
pScrn->frameY0 = 0;
drv_adjust_frame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
pipe_texture_reference(&ms->root_texture, tex);
pipe_texture_reference(&tex, NULL);
pipe_resource_reference(&ms->root_texture, tex);
pipe_resource_reference(&tex, NULL);
ms->fb_id = fb_id;
return TRUE;
err_destroy:
pipe_texture_reference(&tex, NULL);
pipe_resource_reference(&tex, NULL);
return FALSE;
}
......@@ -1051,7 +1051,7 @@ drv_bind_front_buffer_ga3d(ScrnInfoPtr pScrn)
modesettingPtr ms = modesettingPTR(pScrn);
ScreenPtr pScreen = pScrn->pScreen;
PixmapPtr rootPixmap = pScreen->GetScreenPixmap(pScreen);
struct pipe_texture *check;
struct pipe_resource *check;
xorg_exa_set_displayed_usage(rootPixmap);
xorg_exa_set_shared_usage(rootPixmap);
......@@ -1063,7 +1063,7 @@ drv_bind_front_buffer_ga3d(ScrnInfoPtr pScrn)
if (ms->root_texture != check)
FatalError("Created new root texture\n");
pipe_texture_reference(&check, NULL);
pipe_resource_reference(&check, NULL);
return TRUE;
}
......
......@@ -188,7 +188,7 @@ ExaDownloadFromScreen(PixmapPtr pPix, int x, int y, int w, int h, char *dst,
if (!priv || !priv->tex)
return FALSE;
transfer = exa->pipe->get_transfer(exa->pipe, priv->tex, 0, 0, 0,
transfer = pipe_get_transfer(exa->pipe, priv->tex, 0, 0, 0,
PIPE_TRANSFER_READ, x, y, w, h);
if (!transfer)
return FALSE;
......@@ -203,7 +203,7 @@ ExaDownloadFromScreen(PixmapPtr pPix, int x, int y, int w, int h, char *dst,
transfer->stride, 0, 0);
exa->pipe->transfer_unmap(exa->pipe, transfer);
exa->pipe->tex_transfer_destroy(exa->pipe, transfer);
exa->pipe->transfer_destroy(exa->pipe, transfer);
return TRUE;
}
......@@ -222,7 +222,7 @@ ExaUploadToScreen(PixmapPtr pPix, int x, int y, int w, int h, char *src,
if (!priv || !priv->tex)
return FALSE;
transfer = exa->pipe->get_transfer(exa->pipe, priv->tex, 0, 0, 0,
transfer = pipe_get_transfer(exa->pipe, priv->tex, 0, 0, 0,
PIPE_TRANSFER_WRITE, x, y, w, h);
if (!transfer)
return FALSE;
......@@ -237,7 +237,7 @@ ExaUploadToScreen(PixmapPtr pPix, int x, int y, int w, int h, char *src,
(unsigned char*)src, src_pitch, 0, 0);
exa->pipe->transfer_unmap(exa->pipe, transfer);
exa->pipe->tex_transfer_destroy(exa->pipe, transfer);
exa->pipe->transfer_destroy(exa->pipe, transfer);
return TRUE;
}
......@@ -264,20 +264,15 @@ ExaPrepareAccess(PixmapPtr pPix, int index)
assert(pPix->drawable.width <= priv->tex->width0);
assert(pPix->drawable.height <= priv->tex->height0);
u_box_wh(&box,
pPix->drawable.width,
pPix->drawable.height);
priv->map_transfer =
exa->pipe->get_transfer(exa->pipe,
priv->tex,
u_subresource(0, 0),
pipe_get_transfer(exa->pipe, priv->tex, 0, 0, 0,
#ifdef EXA_MIXED_PIXMAPS
PIPE_TRANSFER_MAP_DIRECTLY |
PIPE_TRANSFER_MAP_DIRECTLY |
#endif
PIPE_TRANSFER_READ_WRITE,
&box );
PIPE_TRANSFER_READ_WRITE,
0, 0,
pPix->drawable.width,
pPix->drawable.height );
if (!priv->map_transfer)
#ifdef EXA_MIXED_PIXMAPS
return FALSE;
......@@ -314,7 +309,7 @@ ExaFinishAccess(PixmapPtr pPix, int index)
if (--priv->map_count == 0) {
assert(priv->map_transfer);
exa->pipe->transfer_unmap(exa->pipe, priv->map_transfer);
exa->pipe->tex_transfer_destroy(exa->pipe, priv->map_transfer);
exa->pipe->transfer_destroy(exa->pipe, priv->map_transfer);
priv->map_transfer = NULL;
pPix->devPrivate.ptr = NULL;
}
......@@ -473,7 +468,7 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
exa->copy.src_texture = renderer_clone_texture( exa->renderer,
exa->copy.src->tex );
else
pipe_texture_reference(&exa->copy.src_texture,
pipe_resource_reference(&exa->copy.src_texture,
exa->copy.src->tex);
exa->copy.dst_surface =
......@@ -546,7 +541,7 @@ ExaDoneCopy(PixmapPtr pPixmap)
exa->copy.dst = NULL;
pipe_surface_reference(&exa->copy.src_surface, NULL);
pipe_surface_reference(&exa->copy.dst_surface, NULL);
pipe_texture_reference(&exa->copy.src_texture, NULL);
pipe_resource_reference(&exa->copy.src_texture, NULL);
}
......@@ -749,7 +744,7 @@ ExaDestroyPixmap(ScreenPtr pScreen, void *dPriv)
if (!priv)
return;
pipe_texture_reference(&priv->tex, NULL);
pipe_resource_reference(&priv->tex, NULL);
xfree(priv);
}
......@@ -872,8 +867,8 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
!size_match(width, priv->tex->width0) ||
!size_match(height, priv->tex->height0) ||
priv->tex_flags != priv->flags)) {
struct pipe_texture *texture = NULL;
struct pipe_texture template;
struct pipe_resource *texture = NULL;
struct pipe_resource template;
memset(&template, 0, sizeof(template));
template.target = PIPE_TEXTURE_2D;
......@@ -891,7 +886,7 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
template.last_level = 0;
template.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET | priv->flags;
priv->tex_flags = priv->flags;
texture = exa->scrn->texture_create(exa->scrn, &template);
texture = exa->scrn->resource_create(exa->scrn, &template);
if (priv->tex) {
struct pipe_surface *dst_surf;
......@@ -913,25 +908,25 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
exa->scrn->tex_surface_destroy(src_surf);
}
pipe_texture_reference(&priv->tex, texture);
pipe_resource_reference(&priv->tex, texture);
/* the texture we create has one reference */
pipe_texture_reference(&texture, NULL);
pipe_resource_reference(&texture, NULL);
}
return TRUE;
}
struct pipe_texture *
struct pipe_resource *
xorg_exa_get_texture(PixmapPtr pPixmap)
{
struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pPixmap);
struct pipe_texture *tex = NULL;
pipe_texture_reference(&tex, priv->tex);
struct pipe_resource *tex = NULL;
pipe_resource_reference(&tex, priv->tex);
return tex;
}
Bool
xorg_exa_set_texture(PixmapPtr pPixmap, struct pipe_texture *tex)
xorg_exa_set_texture(PixmapPtr pPixmap, struct pipe_resource *tex)
{
struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pPixmap);
......@@ -944,20 +939,20 @@ xorg_exa_set_texture(PixmapPtr pPixmap, struct pipe_texture *tex)
pPixmap->drawable.height != tex->height0)
return FALSE;
pipe_texture_reference(&priv->tex, tex);
pipe_resource_reference(&priv->tex, tex);
priv->tex_flags = tex->tex_usage & mask;
return TRUE;
}
struct pipe_texture *
struct pipe_resource *
xorg_exa_create_root_texture(ScrnInfoPtr pScrn,
int width, int height,
int depth, int bitsPerPixel)
{
modesettingPtr ms = modesettingPTR(pScrn);
struct exa_context *exa = ms->exa;
struct pipe_texture template;
struct pipe_resource template;
int dummy;
memset(&template, 0, sizeof(template));
......@@ -971,7 +966,7 @@ xorg_exa_create_root_texture(ScrnInfoPtr pScrn,
template.tex_usage |= PIPE_TEXTURE_USAGE_SCANOUT;
template.tex_usage |= PIPE_TEXTURE_USAGE_SHARED;
return exa->scrn->texture_create(exa->scrn, &template);
return exa->scrn->resource_create(exa->scrn, &template);
}
void
......
......@@ -43,7 +43,7 @@ struct exa_context
struct pipe_surface *src_surface;
struct pipe_surface *dst_surface;
struct pipe_texture *src_texture;
struct pipe_resource *src_texture;
} copy;
};
......@@ -56,8 +56,8 @@ struct exa_pixmap_priv
int picture_format;
struct pipe_texture *tex;
struct pipe_texture *depth_stencil_tex;
struct pipe_resource *tex;
struct pipe_resource *depth_stencil_tex;
struct pipe_transfer *map_transfer;
unsigned map_count;
......
......@@ -42,14 +42,16 @@ static INLINE void map_point(float *mat, float x, float y,
}
}
static INLINE struct pipe_buffer *
static INLINE struct pipe_resource *
renderer_buffer_create(struct xorg_renderer *r)
{
struct pipe_buffer *buf =
struct pipe_resource *buf =
pipe_user_buffer_create(r->pipe->screen,
r->buffer,
sizeof(float)*
r->buffer_size);
r->buffer_size,
(PIPE_BUFFER_USAGE_PIXEL |
PIPE_BUFFER_USAGE_GPU_WRITE));
r->buffer_size = 0;
return buf;
......@@ -59,7 +61,7 @@ static INLINE void
renderer_draw(struct xorg_renderer *r)
{
struct pipe_context *pipe = r->pipe;
struct pipe_buffer *buf = 0;
struct pipe_resource *buf = 0;
int num_verts = r->buffer_size/(r->attrs_per_vertex * NUM_COMPONENTS);
if (!r->buffer_size)
......@@ -76,7 +78,7 @@ renderer_draw(struct xorg_renderer *r)
num_verts, /* verts */
r->attrs_per_vertex); /* attribs/vert */
pipe_buffer_reference(&buf, NULL);
pipe_resource_reference(&buf, NULL);
}
}
......@@ -161,7 +163,7 @@ static void
add_vertex_data1(struct xorg_renderer *r,
float srcX, float srcY, float dstX, float dstY,
float width, float height,
struct pipe_texture *src, float *src_matrix)
struct pipe_resource *src, float *src_matrix)
{
float s0, t0, s1, t1, s2, t2, s3, t3;
float pt0[2], pt1[2], pt2[2], pt3[2];
......@@ -231,8 +233,8 @@ static void
add_vertex_data2(struct xorg_renderer *r,
float srcX, float srcY, float maskX, float maskY,
float dstX, float dstY, float width, float height,
struct pipe_texture *src,
struct pipe_texture *mask,
struct pipe_resource *src,
struct pipe_resource *mask,
float *src_matrix, float *mask_matrix)
{
float src_s0, src_t0, src_s1, src_t1;
......@@ -284,11 +286,11 @@ add_vertex_data2(struct xorg_renderer *r,
src_s0, src_t1, mask_s0, mask_t1);
}
static struct pipe_buffer *
static struct pipe_resource *
setup_vertex_data_yuv(struct xorg_renderer *r,
float srcX, float srcY, float srcW, float srcH,
float dstX, float dstY, float dstW, float dstH,
struct pipe_texture **tex)
struct pipe_resource **tex)
{
float s0, t0, s1, t1;
float spt0[2], spt1[2];
......@@ -390,14 +392,14 @@ struct xorg_renderer * renderer_create(struct pipe_context *pipe)
void renderer_destroy(struct xorg_renderer *r)
{
struct pipe_buffer **vsbuf = &r->vs_const_buffer;
struct pipe_buffer **fsbuf = &r->fs_const_buffer;
struct pipe_resource **vsbuf = &r->vs_const_buffer;
struct pipe_resource **fsbuf = &r->fs_const_buffer;
if (*vsbuf)
pipe_buffer_reference(vsbuf, NULL);
pipe_resource_reference(vsbuf, NULL);
if (*fsbuf)
pipe_buffer_reference(fsbuf, NULL);
pipe_resource_reference(fsbuf, NULL);
if (r->shaders) {
xorg_shaders_destroy(r->shaders);
......@@ -420,17 +422,17 @@ void renderer_set_constants(struct xorg_renderer *r,
const float *params,
int param_bytes)
{
struct pipe_buffer **cbuf =
struct pipe_resource **cbuf =
(shader_type == PIPE_SHADER_VERTEX) ? &r->vs_const_buffer :
&r->fs_const_buffer;
pipe_buffer_reference(cbuf, NULL);
pipe_resource_reference(cbuf, NULL);
*cbuf = pipe_buffer_create(r->pipe->screen, 16,
PIPE_BUFFER_USAGE_CONSTANT,
param_bytes);
if (*cbuf) {
pipe_buffer_write(r->pipe->screen, *cbuf,
pipe_buffer_write(r->pipe, *cbuf,
0, param_bytes, params);
}
r->pipe->set_constant_buffer(r->pipe, shader_type, 0, *cbuf);
......@@ -439,7 +441,7 @@ void renderer_set_constants(struct xorg_renderer *r,
void renderer_copy_prepare(struct xorg_renderer *r,
struct pipe_surface *dst_surface,
struct pipe_texture *src_texture)
struct pipe_resource *src_texture)
{
struct pipe_context *pipe = r->pipe;
struct pipe_screen *screen = pipe->screen;
......@@ -506,17 +508,17 @@ void renderer_copy_prepare(struct xorg_renderer *r,
r->attrs_per_vertex = 2;
}
struct pipe_texture *
struct pipe_resource *
renderer_clone_texture(struct xorg_renderer *r,
struct pipe_texture *src)
struct pipe_resource *src)
{
enum pipe_format format;
struct pipe_context *pipe = r->pipe;
struct pipe_screen *screen = pipe->screen;
struct pipe_texture *pt;
struct pipe_texture templ;
struct pipe_resource *pt;
struct pipe_resource templ;
if (pipe->is_texture_referenced(pipe, src, 0, 0) &
if (pipe->is_resource_referenced(pipe, src, 0, 0) &
PIPE_REFERENCED_FOR_WRITE)
pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
......@@ -536,7 +538,7 @@ renderer_clone_texture(struct xorg_renderer *r,
templ.depth0 = 1;
templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER;
pt = screen->texture_create(screen, &templ);
pt = screen->resource_create(screen, &templ);
debug_assert(!pt || pipe_is_referenced(&pt->reference));
......@@ -608,10 +610,10 @@ void renderer_copy_pixmap(struct xorg_renderer *r,
void renderer_draw_yuv(struct xorg_renderer *r,
int src_x, int src_y, int src_w, int src_h,
int dst_x, int dst_y, int dst_w, int dst_h,
struct pipe_texture **textures)
struct pipe_resource **textures)
{
struct pipe_context *pipe = r->pipe;
struct pipe_buffer *buf = 0;
struct pipe_resource *buf = 0;
buf = setup_vertex_data_yuv(r,
src_x, src_y, src_w, src_h,
......@@ -628,7 +630,7 @@ void renderer_draw_yuv(struct xorg_renderer *r,
4, /* verts */
num_attribs); /* attribs/vert */
pipe_buffer_reference(&buf, NULL);
pipe_resource_reference(&buf, NULL);
}
}
......
......@@ -23,8 +23,8 @@ struct xorg_renderer {
int fb_width;
int fb_height;
struct pipe_buffer *vs_const_buffer;
struct pipe_buffer *fs_const_buffer;
struct pipe_resource *vs_const_buffer;
struct pipe_resource *fs_const_buffer;
float buffer[BUF_SIZE];
int buffer_size;
......@@ -56,7 +56,7 @@ void renderer_set_constants(struct xorg_renderer *r,
void renderer_draw_yuv(struct xorg_renderer *r,
int src_x, int src_y, int src_w, int src_h,
int dst_x, int dst_y, int dst_w, int dst_h,
struct pipe_texture **textures);
struct pipe_resource **textures);
void renderer_begin_solid(struct xorg_renderer *r);
void renderer_solid(struct xorg_renderer *r,
......@@ -77,13 +77,13 @@ void renderer_texture(struct xorg_renderer *r,
void renderer_draw_flush(struct xorg_renderer *r);
struct pipe_texture *
struct pipe_resource *
renderer_clone_texture(struct xorg_renderer *r,
struct pipe_texture *src);
struct pipe_resource *src);
void renderer_copy_prepare(struct xorg_renderer *r,
struct pipe_surface *dst_surface,
struct pipe_texture *src_texture);
struct pipe_resource *src_texture);
void renderer_copy_pixmap(struct xorg_renderer *r,
int dx, int dy,
......
......@@ -118,7 +118,7 @@ typedef struct _modesettingRec
struct pipe_context *ctx;
boolean d_depth_bits_last;
boolean ds_depth_bits_last;
struct pipe_texture *root_texture;
struct pipe_resource *root_texture;
/* exa */
struct exa_context *exa;
......@@ -142,7 +142,7 @@ Bool xorg_has_gallium(ScrnInfoPtr pScrn);
/***********************************************************************
* xorg_exa.c
*/
struct pipe_texture *
struct pipe_resource *
xorg_exa_get_texture(PixmapPtr pPixmap);
int
......@@ -152,9 +152,9 @@ int
xorg_exa_set_shared_usage(PixmapPtr pPixmap);
Bool
xorg_exa_set_texture(PixmapPtr pPixmap, struct pipe_texture *tex);
xorg_exa_set_texture(PixmapPtr pPixmap, struct pipe_resource *tex);
struct pipe_texture *
struct pipe_resource *
xorg_exa_create_root_texture(ScrnInfoPtr pScrn,
int width, int height,
int depth, int bpp);
......
......@@ -91,7 +91,7 @@ struct xorg_xv_port_priv {
int current_set;
/* juggle two sets of seperate Y, U and V
* textures */
struct pipe_texture *yuv[2][3];
struct pipe_resource *yuv[2][3];
struct pipe_sampler_view *yuv_views[2][3];
};
......@@ -156,13 +156,13 @@ query_best_size(ScrnInfoPtr pScrn,
*p_h = drw_h;
}
static INLINE struct pipe_texture *
static INLINE struct pipe_resource *
create_component_texture(struct pipe_context *pipe,
int width, int height)
{
struct pipe_screen *screen = pipe->screen;
struct pipe_texture *tex = 0;
struct pipe_texture templ;
struct pipe_resource *tex = 0;
struct pipe_resource templ;
memset(&templ, 0, sizeof(templ));
templ.target = PIPE_TEXTURE_2D;
......@@ -173,7 +173,7 @@ create_component_texture(struct pipe_context *pipe,
templ.depth0 = 1;
templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER;
tex = screen->texture_create(screen, &templ);
tex = screen->resource_create(screen, &templ);
return tex;
}
......@@ -181,7 +181,7 @@ create_component_texture(struct pipe_context *pipe,
static int
check_yuv_textures(struct xorg_xv_port_priv *priv, int width, int height)
{
struct pipe_texture **dst = priv->yuv[priv->current_set];
struct pipe_resource **dst = priv->yuv[priv->current_set];
struct pipe_sampler_view **dst_view = priv->yuv_views[priv->current_set];
struct pipe_sampler_view view_templ;
struct pipe_context *pipe = priv->r->pipe;
......@@ -189,19 +189,19 @@ check_yuv_textures(struct xorg_xv_port_priv *priv, int width, int height)
if (!dst[0] ||
dst[0]->width0 != width ||
dst[0]->height0 != height) {
pipe_texture_reference(&dst[0], NULL);
pipe_resource_reference(&dst[0], NULL);
pipe_sampler_view_reference(&dst_view[0], NULL);
}
if (!dst[1] ||
dst[1]->width0 != width ||
dst[1]->height0 != height) {
pipe_texture_reference(&dst[1], NULL);
pipe_resource_reference(&dst[1], NULL);
pipe_sampler_view_reference(&dst_view[1], NULL);
}
if (!dst[2] ||
dst[2]->width0 != width ||
dst[2]->height0 != height) {
pipe_texture_reference(&dst[2], NULL);
pipe_resource_reference(&dst[2], NULL);
pipe_sampler_view_reference(&dst_view[2], NULL);
}
......@@ -303,7 +303,7 @@ copy_packed_data(ScrnInfoPtr pScrn,
unsigned short w, unsigned short h)
{
int i, j;
struct pipe_texture **dst = port->yuv[port->current_set];
struct pipe_resource **dst = port->yuv[port->current_set];
struct pipe_transfer *ytrans, *utrans, *vtrans;
struct pipe_context *pipe = port->r->pipe;
char *ymap, *vmap, *umap;
......@@ -311,15 +311,15 @@ copy_packed_data(ScrnInfoPtr pScrn,
int yidx, uidx, vidx;
int y_array_size = w * h;
ytrans = pipe->get_transfer(pipe, dst[0],
ytrans = pipe_get_transfer(pipe, dst[0],
0, 0, 0,
PIPE_TRANSFER_WRITE,
left, top, w, h);
utrans = pipe->get_transfer(pipe, dst[1],
utrans = pipe_get_transfer(pipe, dst[1],
0, 0, 0,
PIPE_TRANSFER_WRITE,
left, top, w, h);
vtrans = pipe->get_transfer(pipe, dst[2],
vtrans = pipe_get_transfer(pipe, dst[2],
0, 0, 0,
PIPE_TRANSFER_WRITE,
left, top, w, h);
......@@ -395,9 +395,9 @@ copy_packed_data(ScrnInfoPtr pScrn,
pipe->transfer_unmap(pipe, ytrans);
pipe->transfer_unmap(pipe, utrans);
pipe->transfer_unmap(pipe, vtrans);
pipe->tex_transfer_destroy(pipe, ytrans);
pipe->tex_transfer_destroy(pipe, utrans);
pipe->tex_transfer_destroy(pipe, vtrans);
pipe->transfer_destroy(pipe, ytrans);
pipe->transfer_destroy(pipe, utrans);
pipe->transfer_destroy(pipe, vtrans);
}
......@@ -416,7 +416,7 @@ draw_yuv(struct xorg_xv_port_priv *port,