*/
{
struct pipe_surface *fb_surf;
+ struct nouveau_pipe_buffer *fb_buf;
struct nouveau_bo_priv *fb_bo;
fb_bo = calloc(1, sizeof(struct nouveau_bo_priv));
fb_bo->base.size = fb_bo->drm.size;
fb_bo->base.device = nv_screen->device;
+ fb_buf = calloc(1, sizeof(struct nouveau_pipe_buffer));
+ fb_buf->bo = &fb_bo->base;
+
fb_surf = calloc(1, sizeof(struct pipe_surface));
fb_surf->cpp = nv_screen->front_cpp;
fb_surf->pitch = nv_screen->front_pitch / fb_surf->cpp;
fb_surf->height = nv_screen->front_height;
fb_surf->refcount = 1;
- fb_surf->buffer = (void *)fb_bo;
+ fb_surf->buffer = &fb_buf->base;
nv->frontbuffer = fb_surf;
}
void (*surface_copy_done)(struct nouveau_context *);
int (*surface_fill)(struct nouveau_context *, struct pipe_surface *,
unsigned, unsigned, unsigned, unsigned, unsigned);
- int (*surface_data)(struct nouveau_context *, struct pipe_surface *,
- unsigned, unsigned, const void *, unsigned,
- unsigned, unsigned, unsigned, unsigned);
};
extern GLboolean nouveau_context_create(const __GLcontextModes *,
OUT_RING (nv->o->handle); \
} while(0)
-#define OUT_RELOC(bo,data,flags,vor,tor) do { \
- nouveau_pushbuf_emit_reloc(nv->channel, nv->channel->pushbuf->cur, \
- (void*)(bo), (data), (flags), (vor), (tor));\
+#define OUT_RELOC(buf,data,flags,vor,tor) do { \
+ nouveau_pipe_emit_reloc(nv->channel, nv->channel->pushbuf->cur, \
+ buf, (data), (flags), (vor), (tor)); \
OUT_RING(0); \
} while(0)
return 0;
}
-static int
-nouveau_pipe_surface_data(struct nouveau_winsys *nvws, struct pipe_surface *dst,
- unsigned dx, unsigned dy, const void *src,
- unsigned src_pitch, unsigned sx, unsigned sy,
- unsigned w, unsigned h)
+int
+nouveau_pipe_emit_reloc(struct nouveau_channel *chan, void *ptr,
+ struct pipe_buffer *buf, uint32_t data,
+ uint32_t flags, uint32_t vor, uint32_t tor)
{
- if (nvws->nv->surface_data(nvws->nv, dst, dx, dy, src, src_pitch, sx,
- sy, w, h))
- return 1;
- return 0;
+ return nouveau_pushbuf_emit_reloc(chan, ptr, nouveau_buffer(buf)->bo,
+ data, flags, vor, tor);
}
struct pipe_context *
nvws->res_alloc = nouveau_resource_alloc;
nvws->res_free = nouveau_resource_free;
- nvws->push_reloc = nouveau_pushbuf_emit_reloc;
+ nvws->push_reloc = nouveau_pipe_emit_reloc;
nvws->push_flush = nouveau_pushbuf_flush;
nvws->grobj_alloc = nouveau_pipe_grobj_alloc;
nvws->surface_copy = nouveau_pipe_surface_copy;
nvws->surface_fill = nouveau_pipe_surface_fill;
- nvws->surface_data = nouveau_pipe_surface_data;
return hw_create(nouveau_create_pipe_winsys(nv), nvws, nv->chipset);
}
#include "pipe/p_winsys.h"
#include "pipe/p_defines.h"
#include "pipe/p_util.h"
+#include "pipe/p_inlines.h"
#include "nouveau_context.h"
#include "nouveau_device.h"
enum pipe_format format, unsigned flags)
{
unsigned pitch = ((width * pf_get_size(format)) + 63) & ~63;
- int ret;
surf->format = format;
surf->width = width;
surf->cpp = pf_get_size(format);
surf->pitch = pitch / surf->cpp;
- surf->buffer = ws->buffer_create(ws, 256, 0, 0);
+ surf->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
+ pitch * height);
if (!surf->buffer)
return 1;
- ret = ws->buffer_data(ws, surf->buffer, pitch * height, NULL, 0);
- if (ret) {
- ws->buffer_reference(ws, &surf->buffer, NULL);
- return ret;
- }
-
return 0;
}
*s = NULL;
if (--surf->refcount <= 0) {
if (surf->buffer)
- ws->buffer_reference(ws, &surf->buffer, NULL);
+ pipe_buffer_reference(ws, &surf->buffer, NULL);
free(surf);
}
}
-static struct pipe_buffer_handle *
+static struct pipe_buffer *
nouveau_pipe_bo_create(struct pipe_winsys *pws, unsigned alignment,
- unsigned flags, unsigned hint)
+ unsigned usage, unsigned size)
{
struct nouveau_pipe_winsys *nvpws = (struct nouveau_pipe_winsys *)pws;
struct nouveau_device *dev = nvpws->nv->nv_screen->device;
- struct nouveau_bo *nvbo = NULL;
+ struct nouveau_pipe_buffer *nvbuf;
+
+ nvbuf = calloc(1, sizeof(*nvbuf));
+ if (!nvbuf)
+ return NULL;
+ nvbuf->base.refcount = 1;
+ nvbuf->base.alignment = alignment;
+ nvbuf->base.usage = usage;
+ nvbuf->base.size = size;
- if (nouveau_bo_new(dev, NOUVEAU_BO_LOCAL, alignment, 0, &nvbo))
+ if (nouveau_bo_new(dev, NOUVEAU_BO_LOCAL, alignment, size, &nvbuf->bo)) {
+ free(nvbuf);
return NULL;
- return (struct pipe_buffer_handle *)nvbo;
+ }
+
+ return &nvbuf->base;
}
-static struct pipe_buffer_handle *
+static struct pipe_buffer *
nouveau_pipe_bo_user_create(struct pipe_winsys *pws, void *ptr, unsigned bytes)
{
struct nouveau_pipe_winsys *nvpws = (struct nouveau_pipe_winsys *)pws;
struct nouveau_device *dev = nvpws->nv->nv_screen->device;
- struct nouveau_bo *nvbo = NULL;
+ struct nouveau_pipe_buffer *nvbuf;
- if (nouveau_bo_user(dev, ptr, bytes, &nvbo))
+ nvbuf = calloc(1, sizeof(*nvbuf));
+ if (!nvbuf)
return NULL;
- return (struct pipe_buffer_handle *)nvbo;
-}
-
-static void *
-nouveau_pipe_bo_map(struct pipe_winsys *pws, struct pipe_buffer_handle *bo,
- unsigned flags)
-{
- struct nouveau_bo *nvbo = (struct nouveau_bo *)bo;
- uint32_t map_flags = 0;
+ nvbuf->base.refcount = 1;
+ nvbuf->base.size = bytes;
- if (flags & PIPE_BUFFER_FLAG_READ)
- map_flags |= NOUVEAU_BO_RD;
- if (flags & PIPE_BUFFER_FLAG_WRITE)
- map_flags |= NOUVEAU_BO_WR;
-
- if (nouveau_bo_map(nvbo, map_flags))
+ if (nouveau_bo_user(dev, ptr, bytes, &nvbuf->bo)) {
+ free(nvbuf);
return NULL;
- return nvbo->map;
-}
-
-static void
-nouveau_pipe_bo_unmap(struct pipe_winsys *pws, struct pipe_buffer_handle *bo)
-{
- struct nouveau_bo *nvbo = (struct nouveau_bo *)bo;
-
- nouveau_bo_unmap(nvbo);
-}
-
-static void
-nouveau_pipe_bo_reference(struct pipe_winsys *pws,
- struct pipe_buffer_handle **ptr,
- struct pipe_buffer_handle *bo)
-{
- struct nouveau_pipe_winsys *nvpws = (struct nouveau_pipe_winsys *)pws;
- struct nouveau_context *nv = nvpws->nv;
- struct nouveau_device *dev = nv->nv_screen->device;
-
- if (*ptr) {
- struct nouveau_bo *nvbo = (struct nouveau_bo *)*ptr;
- FIRE_RING();
- nouveau_bo_del(&nvbo);
- *ptr = NULL;
}
- if (bo) {
- struct nouveau_bo *nvbo = (struct nouveau_bo *)bo, *new = NULL;
- nouveau_bo_ref(dev, nvbo->handle, &new);
- *ptr = bo;
- }
+ return &nvbuf->base;
}
-static int
-nouveau_pipe_bo_data(struct pipe_winsys *pws, struct pipe_buffer_handle *bo,
- unsigned size, const void *data, unsigned usage)
+static void
+nouveau_pipe_bo_del(struct pipe_winsys *ws, struct pipe_buffer *buf)
{
- struct nouveau_bo *nvbo = (struct nouveau_bo *)bo;
-
- if (nvbo->size != size)
- nouveau_bo_resize(nvbo, size);
+ struct nouveau_pipe_buffer *nvbuf = nouveau_buffer(buf);
- if (data) {
- if (nouveau_bo_map(nvbo, NOUVEAU_BO_WR))
- return 1;
- memcpy(nvbo->map, data, size);
- nouveau_bo_unmap(nvbo);
- }
-
- return 0;
+ nouveau_bo_del(&nvbuf->bo);
}
-static int
-nouveau_pipe_bo_subdata(struct pipe_winsys *pws, struct pipe_buffer_handle *bo,
- unsigned long offset, unsigned long size,
- const void *data)
+static void *
+nouveau_pipe_bo_map(struct pipe_winsys *pws, struct pipe_buffer *buf,
+ unsigned flags)
{
- struct nouveau_bo *nvbo = (struct nouveau_bo *)bo;
+ struct nouveau_pipe_buffer *nvbuf = nouveau_buffer(buf);
+ uint32_t map_flags = 0;
- if (nouveau_bo_map(nvbo, NOUVEAU_BO_WR))
- return 1;
- memcpy(nvbo->map + offset, data, size);
- nouveau_bo_unmap(nvbo);
+ if (flags & PIPE_BUFFER_USAGE_CPU_READ)
+ map_flags |= NOUVEAU_BO_RD;
+ if (flags & PIPE_BUFFER_USAGE_CPU_WRITE)
+ map_flags |= NOUVEAU_BO_WR;
- return 0;
+ if (nouveau_bo_map(nvbuf->bo, map_flags))
+ return NULL;
+ return nvbuf->bo->map;
}
-static int
-nouveau_pipe_bo_get_subdata(struct pipe_winsys *pws,
- struct pipe_buffer_handle *bo, unsigned long offset,
- unsigned long size, void *data)
+static void
+nouveau_pipe_bo_unmap(struct pipe_winsys *pws, struct pipe_buffer *buf)
{
- struct nouveau_bo *nvbo = (struct nouveau_bo *)bo;
+ struct nouveau_pipe_buffer *nvbuf = nouveau_buffer(buf);
- if (nouveau_bo_map(nvbo, NOUVEAU_BO_RD))
- return 1;
- memcpy(data, nvbo->map + offset, size);
- nouveau_bo_unmap(nvbo);
-
- return 0;
+ nouveau_bo_unmap(nvbuf->bo);
}
struct pipe_winsys *
pws->surface_release = nouveau_surface_release;
pws->buffer_create = nouveau_pipe_bo_create;
+ pws->buffer_destroy = nouveau_pipe_bo_del;
pws->user_buffer_create = nouveau_pipe_bo_user_create;
pws->buffer_map = nouveau_pipe_bo_map;
pws->buffer_unmap = nouveau_pipe_bo_unmap;
- pws->buffer_reference = nouveau_pipe_bo_reference;
- pws->buffer_data = nouveau_pipe_bo_data;
- pws->buffer_subdata = nouveau_pipe_bo_subdata;
- pws->buffer_get_subdata= nouveau_pipe_bo_get_subdata;
pws->get_name = nouveau_get_name;
#include "pipe/p_winsys.h"
#include "nouveau_context.h"
+struct nouveau_pipe_buffer {
+ struct pipe_buffer base;
+ struct nouveau_bo *bo;
+};
+
+static inline struct nouveau_pipe_buffer *
+nouveau_buffer(struct pipe_buffer *buf)
+{
+ return (struct nouveau_pipe_buffer *)buf;
+}
+
struct nouveau_pipe_winsys {
struct pipe_winsys pws;
return 0;
}
-static int
-nv04_surface_data(struct nouveau_context *nv, struct pipe_surface *dst,
- unsigned dx, unsigned dy, const void *src, unsigned src_pitch,
- unsigned sx, unsigned sy, unsigned w, unsigned h)
-{
- NOUVEAU_ERR("unimplemented!!\n");
- return 0;
-}
-
int
nouveau_surface_init_nv04(struct nouveau_context *nv)
{
nv->surface_copy = nv04_surface_copy_blit;
nv->surface_copy_done = nv04_surface_copy_done;
nv->surface_fill = nv04_surface_fill;
- nv->surface_data = nv04_surface_data;
return 0;
}
return 0;
}
-static int
-nv50_surface_data(struct nouveau_context *nv, struct pipe_surface *dst,
- unsigned dx, unsigned dy, const void *src, unsigned src_pitch,
- unsigned sx, unsigned sy, unsigned w, unsigned h)
-{
- NOUVEAU_ERR("unimplemented!!\n");
- return 0;
-}
-
int
nouveau_surface_init_nv50(struct nouveau_context *nv)
{
nv->surface_copy = nv50_surface_copy;
nv->surface_copy_done = nv50_surface_copy_done;
nv->surface_fill = nv50_surface_fill;
- nv->surface_data = nv50_surface_data;
return 0;
}
NOUVEAU_PUSH_CONTEXT(pc); \
pc->nvws->push_reloc(pc->nvws->channel, \
pc->nvws->channel->pushbuf->cur, \
- (struct nouveau_bo *)(bo), \
- (data), (flags), (vor), (tor)); \
+ (bo), (data), (flags), (vor), (tor)); \
OUT_RING(0); \
} while(0)
void (*res_free)(struct nouveau_resource **);
int (*push_reloc)(struct nouveau_channel *, void *ptr,
- struct nouveau_bo *, uint32_t data,
+ struct pipe_buffer *, uint32_t data,
uint32_t flags, uint32_t vor, uint32_t tor);
int (*push_flush)(struct nouveau_channel *, unsigned size);
unsigned, unsigned, unsigned, unsigned);
int (*surface_fill)(struct nouveau_winsys *, struct pipe_surface *,
unsigned, unsigned, unsigned, unsigned, unsigned);
- int (*surface_data)(struct nouveau_winsys *, struct pipe_surface *,
- unsigned, unsigned, const void *, unsigned,
- unsigned, unsigned, unsigned, unsigned);
};
extern struct pipe_context *
unsigned vp_samplers;
uint32_t rt_enable;
- struct pipe_buffer_handle *rt[4];
- struct pipe_buffer_handle *zeta;
+ struct pipe_buffer *rt[4];
+ struct pipe_buffer *zeta;
struct {
- struct pipe_buffer_handle *buffer;
+ struct pipe_buffer *buffer;
uint32_t format;
} tex[16];
unsigned vb_enable;
struct {
- struct pipe_buffer_handle *buffer;
+ struct pipe_buffer *buffer;
unsigned delta;
} vb[16];
struct nv40_vertex_program *active;
struct nv40_vertex_program *current;
- struct pipe_buffer_handle *constant_buf;
+ struct pipe_buffer *constant_buf;
} vertprog;
struct {
struct nv40_fragment_program *active;
struct nv40_fragment_program *current;
- struct pipe_buffer_handle *constant_buf;
+ struct pipe_buffer *constant_buf;
} fragprog;
struct pipe_vertex_buffer vtxbuf[PIPE_ATTRIB_MAX];
extern boolean nv40_draw_arrays(struct pipe_context *, unsigned mode,
unsigned start, unsigned count);
extern boolean nv40_draw_elements(struct pipe_context *pipe,
- struct pipe_buffer_handle *indexBuffer,
+ struct pipe_buffer *indexBuffer,
unsigned indexSize,
unsigned mode, unsigned start,
unsigned count);
};
static void
-nv40_draw_begin(struct draw_stage *draw)
-{
- NOUVEAU_ERR("\n");
-}
-
-static void
-nv40_draw_end(struct draw_stage *draw)
+nv40_draw_point(struct draw_stage *draw, struct prim_header *prim)
{
NOUVEAU_ERR("\n");
}
static void
-nv40_draw_point(struct draw_stage *draw, struct prim_header *prim)
+nv40_draw_line(struct draw_stage *draw, struct prim_header *prim)
{
NOUVEAU_ERR("\n");
}
static void
-nv40_draw_line(struct draw_stage *draw, struct prim_header *prim)
+nv40_draw_tri(struct draw_stage *draw, struct prim_header *prim)
{
NOUVEAU_ERR("\n");
}
static void
-nv40_draw_tri(struct draw_stage *draw, struct prim_header *prim)
+nv40_draw_flush(struct draw_stage *draw, unsigned flags)
{
- NOUVEAU_ERR("\n");
}
static void
nv40draw->nv40 = nv40;
nv40draw->draw.draw = nv40->draw;
- nv40draw->draw.begin = nv40_draw_begin;
nv40draw->draw.point = nv40_draw_point;
nv40draw->draw.line = nv40_draw_line;
nv40draw->draw.tri = nv40_draw_tri;
- nv40draw->draw.end = nv40_draw_end;
+ nv40draw->draw.flush = nv40_draw_flush;
nv40draw->draw.reset_stipple_counter = nv40_draw_reset_stipple_counter;
nv40draw->draw.destroy = nv40_draw_destroy;
if (fp->nr_consts) {
float *map = ws->buffer_map(ws, nv40->fragprog.constant_buf,
- PIPE_BUFFER_FLAG_READ);
+ PIPE_BUFFER_USAGE_CPU_READ);
for (i = 0; i < fp->nr_consts; i++) {
struct nv40_fragment_program_data *fpd = &fp->consts[i];
uint32_t *p = &fp->insn[fpd->offset];
uint32_t *map;
if (!fp->buffer)
- fp->buffer = ws->buffer_create(ws, 0x100, 0, 0);
- ws->buffer_data(ws, fp->buffer, fp->insn_len * 4, NULL, 0);
-
- map = ws->buffer_map(ws, fp->buffer, PIPE_BUFFER_FLAG_WRITE);
+ fp->buffer = ws->buffer_create(ws, 0x100, 0,
+ fp->insn_len * 4);
+ map = ws->buffer_map(ws, fp->buffer,
+ PIPE_BUFFER_USAGE_CPU_WRITE);
#if 0
for (i = 0; i < fp->insn_len; i++) {
#include "pipe/p_state.h"
#include "pipe/p_defines.h"
#include "pipe/p_util.h"
+#include "pipe/p_inlines.h"
#include "nv40_context.h"
nv40_miptree_layout(nv40mt);
- nv40mt->buffer = ws->buffer_create(ws, 256, 0, 0);
+ nv40mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
+ nv40mt->total_size);
if (!nv40mt->buffer) {
free(nv40mt);
return;
}
- ws->buffer_data(ws, nv40mt->buffer, nv40mt->total_size, NULL,
- PIPE_BUFFER_USAGE_PIXEL);
*pt = &nv40mt->base;
}
struct nv40_miptree *nv40mt = (struct nv40_miptree *)mt;
int l;
- ws->buffer_reference(ws, &nv40mt->buffer, NULL);
+ pipe_buffer_reference(ws, &nv40mt->buffer, NULL);
for (l = mt->first_level; l <= mt->last_level; l++) {
if (nv40mt->level[l].image_offset)
free(nv40mt->level[l].image_offset);
NV40TCL_RT_ENABLE_COLOR3))
rt_enable |= NV40TCL_RT_ENABLE_MRT;
- if (fb->zbuf) {
+ if (fb->zsbuf) {
if (colour_format) {
- assert(w == fb->zbuf->width);
- assert(h == fb->zbuf->height);
+ assert(w == fb->zsbuf->width);
+ assert(h == fb->zsbuf->height);
} else {
- w = fb->zbuf->width;
- h = fb->zbuf->height;
+ w = fb->zsbuf->width;
+ h = fb->zsbuf->height;
}
- zeta_format = fb->zbuf->format;
- zeta = fb->zbuf;
- }
-
- if (fb->sbuf) {
- if (colour_format) {
- assert(w == fb->sbuf->width);
- assert(h == fb->sbuf->height);
- } else {
- w = fb->zbuf->width;
- h = fb->zbuf->height;
- }
-
- if (zeta_format) {
- assert(fb->sbuf->format == zeta_format);
- assert(fb->sbuf == zeta);
- } else {
- zeta_format = fb->sbuf->format;
- zeta = fb->sbuf;
- }
+ zeta_format = fb->zsbuf->format;
+ zeta = fb->zsbuf;
}
rt_format = NV40TCL_RT_FORMAT_TYPE_LINEAR;
struct nv40_fragment_program_data *consts;
unsigned nr_consts;
- struct pipe_buffer_handle *buffer;
+ struct pipe_buffer *buffer;
uint32_t fp_control;
};
struct nv40_miptree {
struct pipe_texture base;
- struct pipe_buffer_handle *buffer;
+ struct pipe_buffer *buffer;
uint total_size;
struct {
ps = ws->surface_alloc(ws);
if (!ps)
return NULL;
- ws->buffer_reference(ws, &ps->buffer, nv40mt->buffer);
+ pipe_buffer_reference(ws, &ps->buffer, nv40mt->buffer);
ps->format = pt->format;
ps->cpp = pt->cpp;
ps->width = pt->width[level];
return ps;
}
-static void
-nv40_surface_data(struct pipe_context *pipe, struct pipe_surface *dest,
- unsigned destx, unsigned desty, const void *src,
- unsigned src_stride, unsigned srcx, unsigned srcy,
- unsigned width, unsigned height)
-{
- struct nv40_context *nv40 = nv40_context(pipe);
- struct nouveau_winsys *nvws = nv40->nvws;
-
- nvws->surface_data(nvws, dest, destx, desty, src, src_stride,
- srcx, srcy, width, height);
-}
-
static void
nv40_surface_copy(struct pipe_context *pipe, struct pipe_surface *dest,
unsigned destx, unsigned desty, struct pipe_surface *src,
{
nv40->pipe.is_format_supported = nv40_surface_format_supported;
nv40->pipe.get_tex_surface = nv40_get_tex_surface;
- nv40->pipe.get_tile = pipe_get_tile_raw;
- nv40->pipe.put_tile = pipe_put_tile_raw;
- nv40->pipe.surface_data = nv40_surface_data;
nv40->pipe.surface_copy = nv40_surface_copy;
nv40->pipe.surface_fill = nv40_surface_fill;
}
type = nv40_vbo_type(ve->src_format);
ncomp = nv40_vbo_ncomp(ve->src_format);
- map = ws->buffer_map(ws, vb->buffer, PIPE_BUFFER_FLAG_READ);
+ map = ws->buffer_map(ws, vb->buffer, PIPE_BUFFER_USAGE_CPU_READ);
map += vb->buffer_offset + ve->src_offset;
switch (type) {
static boolean
nv40_vbo_validate_state(struct nv40_context *nv40,
- struct pipe_buffer_handle *ib, unsigned ib_format)
+ struct pipe_buffer *ib, unsigned ib_format)
{
unsigned inputs;
static boolean
nv40_draw_elements_inline(struct pipe_context *pipe,
- struct pipe_buffer_handle *ib, unsigned ib_size,
+ struct pipe_buffer *ib, unsigned ib_size,
unsigned mode, unsigned start, unsigned count)
{
struct nv40_context *nv40 = nv40_context(pipe);
assert(nv40_vbo_validate_state(nv40, NULL, 0));
- map = ws->buffer_map(ws, ib, PIPE_BUFFER_FLAG_READ);
+ map = ws->buffer_map(ws, ib, PIPE_BUFFER_USAGE_CPU_READ);
if (!ib)
assert(0);
static boolean
nv40_draw_elements_vbo(struct pipe_context *pipe,
- struct pipe_buffer_handle *ib, unsigned ib_size,
+ struct pipe_buffer *ib, unsigned ib_size,
unsigned mode, unsigned start, unsigned count)
{
struct nv40_context *nv40 = nv40_context(pipe);
boolean
nv40_draw_elements(struct pipe_context *pipe,
- struct pipe_buffer_handle *indexBuffer, unsigned indexSize,
+ struct pipe_buffer *indexBuffer, unsigned indexSize,
unsigned mode, unsigned start, unsigned count)
{
if (indexSize != 1) {
if (nv40->vertprog.constant_buf) {
map = ws->buffer_map(ws, nv40->vertprog.constant_buf,
- PIPE_BUFFER_FLAG_READ);
+ PIPE_BUFFER_USAGE_CPU_READ);
}
for (i = 0; i < vp->nr_consts; i++) {
extern boolean nv50_draw_arrays(struct pipe_context *, unsigned mode,
unsigned start, unsigned count);
extern boolean nv50_draw_elements(struct pipe_context *pipe,
- struct pipe_buffer_handle *indexBuffer,
+ struct pipe_buffer *indexBuffer,
unsigned indexSize,
unsigned mode, unsigned start,
unsigned count);
};
static void
-nv50_draw_begin(struct draw_stage *draw)
-{
- NOUVEAU_ERR("\n");
-}
-
-static void
-nv50_draw_end(struct draw_stage *draw)
+nv50_draw_point(struct draw_stage *draw, struct prim_header *prim)
{
NOUVEAU_ERR("\n");
}
static void
-nv50_draw_point(struct draw_stage *draw, struct prim_header *prim)
+nv50_draw_line(struct draw_stage *draw, struct prim_header *prim)
{
NOUVEAU_ERR("\n");
}
static void
-nv50_draw_line(struct draw_stage *draw, struct prim_header *prim)
+nv50_draw_tri(struct draw_stage *draw, struct prim_header *prim)
{
NOUVEAU_ERR("\n");
}
static void
-nv50_draw_tri(struct draw_stage *draw, struct prim_header *prim)
+nv50_draw_flush(struct draw_stage *draw, unsigned flags)
{
- NOUVEAU_ERR("\n");
}
static void
nv50draw->nv50 = nv50;
nv50draw->draw.draw = nv50->draw;
- nv50draw->draw.begin = nv50_draw_begin;
nv50draw->draw.point = nv50_draw_point;
nv50draw->draw.line = nv50_draw_line;
nv50draw->draw.tri = nv50_draw_tri;
- nv50draw->draw.end = nv50_draw_end;
+ nv50draw->draw.flush = nv50_draw_flush;
nv50draw->draw.reset_stipple_counter = nv50_draw_reset_stipple_counter;
return &nv50draw->draw;
return NULL;
}
-static void
-nv50_surface_data(struct pipe_context *pipe, struct pipe_surface *dest,
- unsigned destx, unsigned desty, const void *src,
- unsigned src_stride, unsigned srcx, unsigned srcy,
- unsigned width, unsigned height)
-{
- struct nv50_context *nv50 = (struct nv50_context *)pipe;
- struct nouveau_winsys *nvws = nv50->nvws;
-
- nvws->surface_data(nvws, dest, destx, desty, src, src_stride,
- srcx, srcy, width, height);
-}
-
static void
nv50_surface_copy(struct pipe_context *pipe, struct pipe_surface *dest,
unsigned destx, unsigned desty, struct pipe_surface *src,
nv50_init_surface_functions(struct nv50_context *nv50)
{
nv50->pipe.get_tex_surface = nv50_get_tex_surface;
- nv50->pipe.get_tile = pipe_get_tile_raw;
- nv50->pipe.put_tile = pipe_put_tile_raw;
- nv50->pipe.surface_data = nv50_surface_data;
nv50->pipe.surface_copy = nv50_surface_copy;
nv50->pipe.surface_fill = nv50_surface_fill;
}
boolean
nv50_draw_elements(struct pipe_context *pipe,
- struct pipe_buffer_handle *indexBuffer, unsigned indexSize,
+ struct pipe_buffer *indexBuffer, unsigned indexSize,
unsigned mode, unsigned start, unsigned count)
{
NOUVEAU_ERR("unimplemented\n");