Commit c6c7e674 authored by Roland Scheidegger's avatar Roland Scheidegger

gallium: more bind change compile fixes

parent a83fa150
......@@ -130,9 +130,9 @@ cell_resource_create(struct pipe_screen *screen,
/* Create both a displaytarget (linear) and regular texture
* (twiddled). Convert twiddled->linear at flush_frontbuffer time.
*/
if (ct->base.tex_usage & (PIPE_BIND_DISPLAY_TARGET |
PIPE_BIND_SCANOUT |
PIPE_BIND_SHARED)) {
if (ct->base.bind & (PIPE_BIND_DISPLAY_TARGET |
PIPE_BIND_SCANOUT |
PIPE_BIND_SHARED)) {
if (!cell_displaytarget_layout(screen, ct))
goto fail;
}
......@@ -562,8 +562,8 @@ cell_flush_frontbuffer(struct pipe_screen *_screen,
*/
{
unsigned *map = winsys->displaytarget_map(winsys, ct->dt,
(PIPE_BUFFER_USAGE_CPU_READ |
PIPE_BUFFER_USAGE_CPU_WRITE));
(PIPE_TRANSFER_READ |
PIPE_TRANSFER_WRITE));
unsigned *src = (unsigned *)(ct->data + ct->level_offset[surface->level]);
untwiddle_image_uint(surface->width,
......@@ -599,7 +599,7 @@ cell_user_buffer_create(struct pipe_screen *screen,
pipe_reference_init(&buffer->base.reference, 1);
buffer->base.screen = screen;
buffer->base.format = PIPE_FORMAT_R8_UNORM; /* ?? */
buffer->base.bind = PIPE_TRANSFER_READ | bind_flags;
buffer->base.bind = PIPE_BIND_TRANSFER_READ | bind_flags;
buffer->base._usage = PIPE_USAGE_IMMUTABLE;
buffer->base.flags = 0;
buffer->base.width0 = bytes;
......
......@@ -53,9 +53,9 @@ kms_surface_validate(struct native_surface *nsurf, uint attachment_mask,
templ.height0 = ksurf->height;
templ.depth0 = 1;
templ.format = ksurf->color_format;
templ.tex_usage = PIPE_BIND_RENDER_TARGET;
templ.bind = PIPE_BIND_RENDER_TARGET;
if (ksurf->type == KMS_SURFACE_TYPE_SCANOUT)
templ.tex_usage |= PIPE_BIND_SCANOUT;
templ.bind |= PIPE_BIND_SCANOUT;
}
/* create textures */
......
......@@ -143,7 +143,7 @@ static void read_alpha_mask(void * data, VGint dataStride,
struct pipe_surface *surf;
surf = screen->get_tex_surface(screen, strb->texture, 0, 0, 0,
PIPE_BUFFER_USAGE_CPU_READ);
PIPE_BIND_TRANSFER_READ);
/* Do a row at a time to flip image data vertically */
for (i = 0; i < height; i++) {
......@@ -496,7 +496,7 @@ struct vg_mask_layer * mask_layer_create(VGint width, VGint height)
pt.width0 = width;
pt.height0 = height;
pt.depth0 = 1;
pt.tex_usage = PIPE_BIND_SAMPLER_VIEW;
pt.bind = PIPE_BIND_SAMPLER_VIEW;
pt.compressed = 0;
texture = screen->resource_create(screen, &pt);
......@@ -537,7 +537,7 @@ void mask_layer_fill(struct vg_mask_layer *layer,
surface = ctx->pipe->screen->get_tex_surface(
ctx->pipe->screen, layer->sampler_view->texture,
0, 0, 0,
PIPE_BUFFER_USAGE_GPU_WRITE);
PIPE_BIND_RENDER_TARGET);
surface_fill(surface,
layer->width, layer->height,
......@@ -573,7 +573,7 @@ static void mask_layer_render_to(struct vg_mask_layer *layer,
struct pipe_surface *surface;
surface = screen->get_tex_surface(screen, layer->sampler_view->texture, 0, 0, 0,
PIPE_BUFFER_USAGE_GPU_WRITE);
PIPE_BIND_RENDER_TARGET);
cso_save_framebuffer(ctx->cso_context);
cso_save_fragment_shader(ctx->cso_context);
......
......@@ -201,8 +201,8 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image)
struct winsys_handle whandle;
memset(&templat, 0, sizeof(templat));
templat.tex_usage |= PIPE_BIND_RENDER_TARGET;
templat.tex_usage |= PIPE_BIND_SCANOUT;
templat.bind |= PIPE_BIND_RENDER_TARGET;
templat.bind |= PIPE_BIND_SCANOUT;
templat.target = PIPE_TEXTURE_2D;
templat.last_level = 0;
templat.depth0 = 1;
......
......@@ -128,7 +128,7 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int form
template.height0 = pDraw->height;
template.depth0 = 1;
template.last_level = 0;
template.tex_usage = PIPE_BIND_DEPTH_STENCIL |
template.bind = PIPE_BIND_DEPTH_STENCIL |
PIPE_BIND_SHARED;
tex = ms->screen->resource_create(ms->screen, &template);
pipe_resource_reference(&exa_priv->depth_stencil_tex, tex);
......
......@@ -453,13 +453,13 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
exa->scrn->get_tex_surface( exa->scrn,
exa->copy.src->tex,
0, 0, 0,
PIPE_BUFFER_USAGE_GPU_READ);
PIPE_BIND_BLIT_SOURCE);
exa->copy.dst_surface =
exa->scrn->get_tex_surface( exa->scrn,
exa->copy.dst->tex,
0, 0, 0,
PIPE_BUFFER_USAGE_GPU_WRITE );
PIPE_BIND_BLIT_DESTINATION );
}
else {
exa->copy.use_surface_copy = FALSE;
......@@ -475,7 +475,7 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
exa->scrn->get_tex_surface(exa->scrn,
exa->copy.dst->tex,
0, 0, 0,
PIPE_BUFFER_USAGE_GPU_WRITE);
PIPE_BIND_BLIT_DESTINATION);
renderer_copy_prepare(exa->renderer,
......@@ -884,7 +884,7 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
template.depth0 = 1;
template.last_level = 0;
template.tex_usage = PIPE_BIND_RENDER_TARGET | priv->flags;
template.bind = PIPE_BIND_RENDER_TARGET | priv->flags;
priv->tex_flags = priv->flags;
texture = exa->scrn->resource_create(exa->scrn, &template);
......@@ -893,7 +893,7 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
struct pipe_surface *src_surf;
dst_surf = exa->scrn->get_tex_surface(
exa->scrn, texture, 0, 0, 0, PIPE_BUFFER_USAGE_GPU_WRITE);
exa->scrn, texture, 0, 0, 0, PIPE_BIND_BLIT_DESTINATION);
src_surf = xorg_gpu_surface(exa->pipe->screen, priv);
if (exa->pipe->surface_copy) {
exa->pipe->surface_copy(exa->pipe, dst_surf, 0, 0, src_surf,
......@@ -940,7 +940,7 @@ xorg_exa_set_texture(PixmapPtr pPixmap, struct pipe_resource *tex)
return FALSE;
pipe_resource_reference(&priv->tex, tex);
priv->tex_flags = tex->tex_usage & mask;
priv->tex_flags = tex->bind & mask;
return TRUE;
}
......@@ -962,9 +962,9 @@ xorg_exa_create_root_texture(ScrnInfoPtr pScrn,
template.height0 = height;
template.depth0 = 1;
template.last_level = 0;
template.tex_usage |= PIPE_BIND_RENDER_TARGET;
template.tex_usage |= PIPE_BIND_SCANOUT;
template.tex_usage |= PIPE_BIND_SHARED;
template.bind |= PIPE_BIND_RENDER_TARGET;
template.bind |= PIPE_BIND_SCANOUT;
template.bind |= PIPE_BIND_SHARED;
return exa->scrn->resource_create(exa->scrn, &template);
}
......@@ -1073,9 +1073,12 @@ out_err:
struct pipe_surface *
xorg_gpu_surface(struct pipe_screen *scrn, struct exa_pixmap_priv *priv)
{
/* seems to get called both for blits and render target usage */
return scrn->get_tex_surface(scrn, priv->tex, 0, 0, 0,
PIPE_BUFFER_USAGE_GPU_READ |
PIPE_BUFFER_USAGE_GPU_WRITE);
PIPE_BIND_BLIT_SOURCE |
PIPE_BIND_BLIT_DESTINATION |
PIPE_BIND_RENDER_TARGET);
}
......
......@@ -50,8 +50,8 @@ renderer_buffer_create(struct xorg_renderer *r)
r->buffer,
sizeof(float)*
r->buffer_size,
(PIPE_BUFFER_USAGE_PIXEL |
PIPE_BUFFER_USAGE_GPU_WRITE));
/* XXX was: PIPE_BUFFER_USAGE_PIXEL/PIPE_BUFFER_USAGE_GPU_WRITE even though this is a vertex buffer??? */
PIPE_BIND_VERTEX_BUFFER);
r->buffer_size = 0;
return buf;
......@@ -427,7 +427,7 @@ void renderer_set_constants(struct xorg_renderer *r,
&r->fs_const_buffer;
pipe_resource_reference(cbuf, NULL);
*cbuf = pipe_buffer_create(r->pipe->screen, 16,
*cbuf = pipe_buffer_create(r->pipe->screen,
PIPE_BIND_CONSTANT_BUFFER,
param_bytes);
......@@ -536,7 +536,7 @@ renderer_clone_texture(struct xorg_renderer *r,
templ.width0 = src->width0;
templ.height0 = src->height0;
templ.depth0 = 1;
templ.tex_usage = PIPE_BIND_SAMPLER_VIEW;
templ.bind = PIPE_BIND_SAMPLER_VIEW;
pt = screen->resource_create(screen, &templ);
......@@ -548,9 +548,9 @@ renderer_clone_texture(struct xorg_renderer *r,
{
/* copy source framebuffer surface into texture */
struct pipe_surface *ps_read = screen->get_tex_surface(
screen, src, 0, 0, 0, PIPE_BUFFER_USAGE_GPU_READ);
screen, src, 0, 0, 0, PIPE_BIND_BLIT_SOURCE);
struct pipe_surface *ps_tex = screen->get_tex_surface(
screen, pt, 0, 0, 0, PIPE_BUFFER_USAGE_GPU_WRITE );
screen, pt, 0, 0, 0, PIPE_BIND_BLIT_DESTINATION );
if (pipe->surface_copy) {
pipe->surface_copy(pipe,
ps_tex, /* dest */
......
......@@ -171,7 +171,7 @@ create_component_texture(struct pipe_context *pipe,
templ.width0 = width;
templ.height0 = height;
templ.depth0 = 1;
templ.tex_usage = PIPE_BIND_SAMPLER_VIEW;
templ.bind = PIPE_BIND_SAMPLER_VIEW;
tex = screen->resource_create(screen, &templ);
......
......@@ -106,15 +106,14 @@ CreateOrResizeBackBuffer(struct pipe_video_context *vpipe, unsigned int width, u
template.width0 = width;
template.height0 = height;
template.depth0 = 1;
template.tex_usage = PIPE_BIND_SHARED;
template.bind = PIPE_BIND_SHARED;
tex = vpipe->screen->resource_create(vpipe->screen, &template);
if (!tex)
return false;
*backbuffer = vpipe->screen->get_tex_surface(vpipe->screen, tex, 0, 0, 0,
PIPE_BUFFER_USAGE_GPU_READ |
PIPE_BUFFER_USAGE_GPU_WRITE);
PIPE_BIND_RENDER_TARGET);
pipe_resource_reference(&tex, NULL);
if (!*backbuffer)
......
......@@ -148,12 +148,16 @@ static uint32_t radeon_domain_from_usage(unsigned usage)
{
uint32_t domain = 0;
if (usage & PIPE_BUFFER_USAGE_GPU_WRITE) {
if (usage & PIPE_BIND_RENDER_TARGET) {
domain |= RADEON_GEM_DOMAIN_VRAM;
}
if (usage & PIPE_BUFFER_USAGE_PIXEL) {
if (usage & PIPE_BIND_DEPTH_STENCIL) {
domain |= RADEON_GEM_DOMAIN_VRAM;
}
if (usage & PIPE_BIND_SAMPLER_VIEW) {
domain |= RADEON_GEM_DOMAIN_VRAM;
}
/* also need BIND_BLIT_SOURCE/DESTINATION ? */
if (usage & PIPE_BIND_VERTEX_BUFFER) {
domain |= RADEON_GEM_DOMAIN_GTT;
}
......@@ -187,7 +191,7 @@ struct pb_buffer *radeon_drm_bufmgr_create_buffer_from_handle(struct pb_manager
pipe_reference_init(&buf->base.base.reference, 1);
buf->base.base.alignment = 0;
buf->base.base.usage = PIPE_BUFFER_USAGE_PIXEL;
buf->base.base.usage = PIPE_BIND_SAMPLER_VIEW;
buf->base.base.size = 0;
buf->base.vtbl = &radeon_drm_buffer_vtbl;
buf->mgr = mgr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment