summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2007-12-09 03:22:14 +1100
committerBen Skeggs <skeggsb@gmail.com>2007-12-09 12:12:50 +1100
commitb8965bee404cb36ccd97ac089fbd3ffc63268080 (patch)
treec303b5737dd51f9cecc79a76389b63dc79f9f8a8 /src/mesa/drivers
parent274a3d9cb6a196c1b191769f581915cf5f8dccfe (diff)
nouveau: adapt to gallium interface changes
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/Makefile.template1
-rw-r--r--src/mesa/drivers/dri/nouveau_winsys/Makefile4
-rw-r--r--src/mesa/drivers/dri/nouveau_winsys/nouveau_context.c36
-rw-r--r--src/mesa/drivers/dri/nouveau_winsys/nouveau_context.h44
-rw-r--r--src/mesa/drivers/dri/nouveau_winsys/nouveau_lock.c15
-rw-r--r--src/mesa/drivers/dri/nouveau_winsys/nouveau_screen.c6
-rw-r--r--src/mesa/drivers/dri/nouveau_winsys/nouveau_swapbuffers.c10
-rw-r--r--src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys.c42
-rw-r--r--src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys_pipe.c61
-rw-r--r--src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys_softpipe.c6
-rw-r--r--src/mesa/drivers/dri/nouveau_winsys/nv04_surface.c (renamed from src/mesa/drivers/dri/nouveau_winsys/nv04_region.c)71
-rw-r--r--src/mesa/drivers/dri/nouveau_winsys/nv50_surface.c (renamed from src/mesa/drivers/dri/nouveau_winsys/nv50_region.c)49
12 files changed, 137 insertions, 208 deletions
diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template
index 37bf0a4977..1d0b0726db 100644
--- a/src/mesa/drivers/dri/Makefile.template
+++ b/src/mesa/drivers/dri/Makefile.template
@@ -3,7 +3,6 @@
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
COMMON_SOURCES = \
- ../../common/driverfuncs.c \
../common/utils.c \
../common/texmem.c \
../common/vblank.c \
diff --git a/src/mesa/drivers/dri/nouveau_winsys/Makefile b/src/mesa/drivers/dri/nouveau_winsys/Makefile
index 292ec5e0a4..9b8a33b725 100644
--- a/src/mesa/drivers/dri/nouveau_winsys/Makefile
+++ b/src/mesa/drivers/dri/nouveau_winsys/Makefile
@@ -25,8 +25,8 @@ DRIVER_SOURCES = \
nouveau_winsys.c \
nouveau_winsys_pipe.c \
nouveau_winsys_softpipe.c \
- nv04_region.c \
- nv50_region.c
+ nv04_surface.c \
+ nv50_surface.c
C_SOURCES = \
$(COMMON_SOURCES) \
diff --git a/src/mesa/drivers/dri/nouveau_winsys/nouveau_context.c b/src/mesa/drivers/dri/nouveau_winsys/nouveau_context.c
index 70655a1a7d..03f1816c32 100644
--- a/src/mesa/drivers/dri/nouveau_winsys/nouveau_context.c
+++ b/src/mesa/drivers/dri/nouveau_winsys/nouveau_context.c
@@ -1,18 +1,8 @@
-#include "glheader.h"
-#include "context.h"
-#include "extensions.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-#include "tnl/t_vertex.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "drirenderbuffer.h"
+#include "main/glheader.h"
+#include "glapi/glthread.h"
+#include <GL/internal/glcore.h>
#include "state_tracker/st_public.h"
-#include "state_tracker/st_context.h"
-
#include "pipe/p_defines.h"
#include "pipe/p_context.h"
@@ -130,7 +120,7 @@ nouveau_context_create(const __GLcontextModes *glVis,
* of the front buffer handle passed to us by the DDX.
*/
{
- struct pipe_region *fb_region;
+ struct pipe_surface *fb_surf;
struct nouveau_bo_priv *fb_bo;
fb_bo = calloc(1, sizeof(struct nouveau_bo_priv));
@@ -145,14 +135,14 @@ nouveau_context_create(const __GLcontextModes *glVis,
fb_bo->base.size = fb_bo->drm.size;
fb_bo->base.device = nv_screen->device;
- fb_region = calloc(1, sizeof(struct pipe_region));
- fb_region->cpp = nv_screen->front_cpp;
- fb_region->pitch = nv_screen->front_pitch / fb_region->cpp;
- fb_region->height = nv_screen->front_height;
- fb_region->refcount = 1;
- fb_region->buffer = (void *)fb_bo;
+ 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;
- nv->frontbuffer = fb_region;
+ nv->frontbuffer = fb_surf;
}
if ((ret = nouveau_grobj_alloc(nv->channel, 0x00000000, 0x30,
@@ -169,9 +159,9 @@ nouveau_context_create(const __GLcontextModes *glVis,
}
if (nv->chipset < 0x50)
- ret = nouveau_region_init_nv04(nv);
+ ret = nouveau_surface_init_nv04(nv);
else
- ret = nouveau_region_init_nv50(nv);
+ ret = nouveau_surface_init_nv50(nv);
if (ret) {
return GL_FALSE;
}
diff --git a/src/mesa/drivers/dri/nouveau_winsys/nouveau_context.h b/src/mesa/drivers/dri/nouveau_winsys/nouveau_context.h
index 70110f9768..7033ff7ae9 100644
--- a/src/mesa/drivers/dri/nouveau_winsys/nouveau_context.h
+++ b/src/mesa/drivers/dri/nouveau_winsys/nouveau_context.h
@@ -1,9 +1,6 @@
#ifndef __NOUVEAU_CONTEXT_H__
#define __NOUVEAU_CONTEXT_H__
-#include "glheader.h"
-#include "context.h"
-
#include "dri_util.h"
#include "xmlconfig.h"
@@ -31,7 +28,7 @@ struct nouveau_context {
drmLock drm_lock;
GLboolean locked;
struct nouveau_screen *nv_screen;
- struct pipe_region *frontbuffer;
+ struct pipe_surface *frontbuffer;
/* Bufmgr */
struct {
@@ -58,29 +55,22 @@ struct nouveau_context {
uint32_t next_handle;
uint32_t next_sequence;
- /* pipe_region accel */
- struct pipe_region *region_src, *region_dst;
- unsigned region_src_offset, region_dst_offset;
- int (*region_copy_prep)(struct nouveau_context *,
- struct pipe_region *dst, uint32_t dst_offset,
- struct pipe_region *src, uint32_t src_offset);
- void (*region_copy)(struct nouveau_context *, unsigned dx, unsigned dy,
- unsigned sx, unsigned sy, unsigned w, unsigned h);
- void (*region_copy_done)(struct nouveau_context *);
- int (*region_fill)(struct nouveau_context *, struct pipe_region *,
- unsigned, unsigned, unsigned, unsigned, unsigned,
- unsigned);
- int (*region_data)(struct nouveau_context *, struct pipe_region *,
- unsigned, unsigned, unsigned, const void *,
- unsigned, unsigned, unsigned, unsigned, unsigned);
+ /* pipe_surface accel */
+ struct pipe_surface *surf_src, *surf_dst;
+ unsigned surf_src_offset, surf_dst_offset;
+ int (*surface_copy_prep)(struct nouveau_context *,
+ struct pipe_surface *dst,
+ struct pipe_surface *src);
+ void (*surface_copy)(struct nouveau_context *, unsigned dx, unsigned dy,
+ unsigned sx, unsigned sy, unsigned w, unsigned h);
+ 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);
};
-static INLINE struct nouveau_context *
-nouveau_context(GLcontext *ctx)
-{
- return (struct nouveau_context *)ctx;
-}
-
extern GLboolean nouveau_context_create(const __GLcontextModes *,
__DRIcontextPrivate *, void *);
extern void nouveau_context_destroy(__DRIcontextPrivate *);
@@ -105,7 +95,7 @@ extern int __nouveau_debug;
extern void LOCK_HARDWARE(struct nouveau_context *);
extern void UNLOCK_HARDWARE(struct nouveau_context *);
-extern int nouveau_region_init_nv04(struct nouveau_context *);
-extern int nouveau_region_init_nv50(struct nouveau_context *);
+extern int nouveau_surface_init_nv04(struct nouveau_context *);
+extern int nouveau_surface_init_nv50(struct nouveau_context *);
#endif
diff --git a/src/mesa/drivers/dri/nouveau_winsys/nouveau_lock.c b/src/mesa/drivers/dri/nouveau_winsys/nouveau_lock.c
index ffe7d01d66..9adb9ac854 100644
--- a/src/mesa/drivers/dri/nouveau_winsys/nouveau_lock.c
+++ b/src/mesa/drivers/dri/nouveau_winsys/nouveau_lock.c
@@ -25,18 +25,9 @@
*
**************************************************************************/
-
-#include "glheader.h"
-#include "context.h"
-#include "extensions.h"
-
-#include "state_tracker/st_public.h"
-#include "state_tracker/st_context.h"
-
-#include "drirenderbuffer.h"
-#include "vblank.h"
-#include "utils.h"
-#include "xmlpool.h" /* for symbolic values of enum-type options */
+#include "main/glheader.h"
+#include "glapi/glthread.h"
+#include <GL/internal/glcore.h>
#include "nouveau_context.h"
#include "nouveau_screen.h"
diff --git a/src/mesa/drivers/dri/nouveau_winsys/nouveau_screen.c b/src/mesa/drivers/dri/nouveau_winsys/nouveau_screen.c
index 6554082e62..a1eed2e44a 100644
--- a/src/mesa/drivers/dri/nouveau_winsys/nouveau_screen.c
+++ b/src/mesa/drivers/dri/nouveau_winsys/nouveau_screen.c
@@ -1,9 +1,3 @@
-#include "glheader.h"
-#include "context.h"
-#include "framebuffer.h"
-#include "matrix.h"
-#include "renderbuffer.h"
-#include "simple_list.h"
#include "utils.h"
#include "vblank.h"
#include "xmlpool.h"
diff --git a/src/mesa/drivers/dri/nouveau_winsys/nouveau_swapbuffers.c b/src/mesa/drivers/dri/nouveau_winsys/nouveau_swapbuffers.c
index 5b2e76b942..91bf243f42 100644
--- a/src/mesa/drivers/dri/nouveau_winsys/nouveau_swapbuffers.c
+++ b/src/mesa/drivers/dri/nouveau_winsys/nouveau_swapbuffers.c
@@ -1,7 +1,10 @@
-#include "context.h"
+#include "main/glheader.h"
+#include "glapi/glthread.h"
+#include <GL/internal/glcore.h>
#include "pipe/p_context.h"
#include "state_tracker/st_public.h"
+#include "state_tracker/st_context.h"
#include "state_tracker/st_cb_fbo.h"
#include "nouveau_context.h"
@@ -14,7 +17,6 @@ nouveau_copy_buffer(__DRIdrawablePrivate *dPriv, struct pipe_surface *surf,
const drm_clip_rect_t *rect)
{
struct nouveau_context *nv = dPriv->driContextPriv->driverPrivate;
- struct pipe_region *p_region = surf->region;
drm_clip_rect_t *pbox;
int nbox, i;
@@ -26,7 +28,7 @@ nouveau_copy_buffer(__DRIdrawablePrivate *dPriv, struct pipe_surface *surf,
pbox = dPriv->pClipRects;
nbox = dPriv->numClipRects;
- nv->region_copy_prep(nv, nv->frontbuffer, 0, p_region, 0);
+ nv->surface_copy_prep(nv, nv->frontbuffer, surf);
for (i = 0; i < nbox; i++, pbox++) {
int sx, sy, dx, dy, w, h;
@@ -37,7 +39,7 @@ nouveau_copy_buffer(__DRIdrawablePrivate *dPriv, struct pipe_surface *surf,
w = pbox->x2 - pbox->x1;
h = pbox->y2 - pbox->y1;
- nv->region_copy(nv, dx, dy, sx, sy, w, h);
+ nv->surface_copy(nv, dx, dy, sx, sy, w, h);
}
FIRE_RING();
diff --git a/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys.c b/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys.c
index e35b6009e3..6ef81ccb86 100644
--- a/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys.c
+++ b/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys.c
@@ -1,3 +1,5 @@
+#include "pipe/p_util.h"
+
#include "nouveau_context.h"
#include "nouveau_winsys_pipe.h"
@@ -128,40 +130,38 @@ nouveau_pipe_dma_kickoff(struct nouveau_channel *userchan)
}
static int
-nouveau_pipe_region_copy(struct nouveau_winsys *nvws, struct pipe_region *dst,
- unsigned dst_offset, unsigned dx, unsigned dy,
- struct pipe_region *src, unsigned src_offset,
- unsigned sx, unsigned sy, unsigned w, unsigned h)
+nouveau_pipe_surface_copy(struct nouveau_winsys *nvws, struct pipe_surface *dst,
+ unsigned dx, unsigned dy, struct pipe_surface *src,
+ unsigned sx, unsigned sy, unsigned w, unsigned h)
{
struct nouveau_context *nv = nvws->nv;
- if (nv->region_copy_prep(nv, dst, dst_offset, src, src_offset))
+ if (nv->surface_copy_prep(nv, dst, src))
return 1;
- nv->region_copy(nv, dx, dy, sx, sy, w, h);
- nv->region_copy_done(nv);
+ nv->surface_copy(nv, dx, dy, sx, sy, w, h);
+ nv->surface_copy_done(nv);
return 0;
}
static int
-nouveau_pipe_region_fill(struct nouveau_winsys *nvws, struct pipe_region *dst,
- unsigned dst_offset, unsigned dx, unsigned dy,
- unsigned w, unsigned h, unsigned value)
+nouveau_pipe_surface_fill(struct nouveau_winsys *nvws, struct pipe_surface *dst,
+ unsigned dx, unsigned dy, unsigned w, unsigned h,
+ unsigned value)
{
- if (nvws->nv->region_fill(nvws->nv, dst, dst_offset, dx, dy,
- w, h, value))
+ if (nvws->nv->surface_fill(nvws->nv, dst, dx, dy, w, h, value))
return 1;
return 0;
}
static int
-nouveau_pipe_region_data(struct nouveau_winsys *nvws, struct pipe_region *dst,
- unsigned dst_offset, unsigned dx, unsigned dy,
- const void *src, unsigned src_pitch,
- unsigned sx, unsigned sy, unsigned w, unsigned h)
+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)
{
- if (nvws->nv->region_data(nvws->nv, dst, dst_offset, dx, dy, src,
- src_pitch, sx, sy, w, h))
+ if (nvws->nv->surface_data(nvws->nv, dst, dx, dy, src, src_pitch, sx,
+ sy, w, h))
return 1;
return 0;
}
@@ -211,9 +211,9 @@ nouveau_pipe_create(struct nouveau_context *nv)
nvws->notifier_retval = nouveau_notifier_return_val;
nvws->notifier_wait = nouveau_notifier_wait_status;
- nvws->region_copy = nouveau_pipe_region_copy;
- nvws->region_fill = nouveau_pipe_region_fill;
- nvws->region_data = nouveau_pipe_region_data;
+ 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);
}
diff --git a/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys_pipe.c b/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys_pipe.c
index 0dd2cec2ca..adbf6b28e8 100644
--- a/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys_pipe.c
+++ b/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys_pipe.c
@@ -1,5 +1,6 @@
#include "pipe/p_winsys.h"
#include "pipe/p_defines.h"
+#include "pipe/p_util.h"
#include "nouveau_context.h"
#include "nouveau_device.h"
@@ -33,46 +34,18 @@ nouveau_get_name(struct pipe_winsys *pws)
return "Nouveau/DRI";
}
-static struct pipe_region *
-nouveau_region_alloc(struct pipe_winsys *ws, unsigned cpp,
- unsigned width, unsigned height, unsigned flags)
+static unsigned
+nouveau_surface_pitch(struct pipe_winsys *ws, unsigned cpp, unsigned width,
+ unsigned flags)
{
- struct pipe_region *region;
-
- region = calloc(sizeof(*region), 1);
- region->cpp = cpp;
- region->pitch = ((cpp * width + 63) & ~63) / cpp;
- region->height = height;
- region->refcount = 1;
- region->buffer = ws->buffer_create(ws, 64);
-
- ws->buffer_data(ws, region->buffer, region->pitch * cpp * height, NULL,
- PIPE_BUFFER_USAGE_PIXEL);
- return region;
-}
-
-static void
-nouveau_region_release(struct pipe_winsys *pws, struct pipe_region **pregion)
-{
- struct pipe_region *region;
-
- if (!pregion || !*pregion)
- return;
- region = *pregion;
- *pregion = NULL;
-
- assert(region->refcount > 0);
- region->refcount--;
+ unsigned pitch = width * cpp;
- if (region->refcount == 0) {
- assert(region->map_refcount == 0);
- pws->buffer_reference(pws, &region->buffer, NULL);
- free(region);
- }
+ pitch = (pitch + 63) & ~63;
+ return pitch / cpp;
}
static struct pipe_surface *
-nouveau_surface_alloc(struct pipe_winsys *pws, unsigned format)
+nouveau_surface_alloc(struct pipe_winsys *ws, unsigned format)
{
struct pipe_surface *surf;
@@ -82,19 +55,19 @@ nouveau_surface_alloc(struct pipe_winsys *pws, unsigned format)
surf->format = format;
surf->refcount = 1;
- surf->winsys = pws;
-
+ surf->winsys = ws;
return surf;
}
static void
-nouveau_surface_release(struct pipe_winsys *pws, struct pipe_surface **s)
+nouveau_surface_release(struct pipe_winsys *ws, struct pipe_surface **s)
{
- struct pipe_surface *surf = *s; *s = NULL;
+ struct pipe_surface *surf = *s;
- if (surf->refcount-- == 0) {
- if (surf->region)
- pws->region_release(pws, &surf->region);
+ *s = NULL;
+ if (--surf->refcount <= 0) {
+ if (surf->buffer)
+ ws->buffer_reference(ws, &surf->buffer, NULL);
free(surf);
}
}
@@ -229,9 +202,7 @@ nouveau_create_pipe_winsys(struct nouveau_context *nv)
pws->flush_frontbuffer = nouveau_flush_frontbuffer;
pws->printf = nouveau_printf;
- pws->region_alloc = nouveau_region_alloc;
- pws->region_release = nouveau_region_release;
-
+ pws->surface_pitch = nouveau_surface_pitch;
pws->surface_alloc = nouveau_surface_alloc;
pws->surface_release = nouveau_surface_release;
diff --git a/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys_softpipe.c b/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys_softpipe.c
index c86575f187..ebce4ddede 100644
--- a/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys_softpipe.c
+++ b/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys_softpipe.c
@@ -49,9 +49,9 @@ static boolean
nouveau_is_format_supported(struct softpipe_winsys *sws, uint format)
{
switch (format) {
- case PIPE_FORMAT_U_A8_R8_G8_B8:
- case PIPE_FORMAT_U_R5_G6_B5:
- case PIPE_FORMAT_S8_Z24:
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ case PIPE_FORMAT_R5G6B5_UNORM:
+ case PIPE_FORMAT_S8Z24_UNORM:
return TRUE;
default:
break;
diff --git a/src/mesa/drivers/dri/nouveau_winsys/nv04_region.c b/src/mesa/drivers/dri/nouveau_winsys/nv04_surface.c
index d41588d890..893f292e23 100644
--- a/src/mesa/drivers/dri/nouveau_winsys/nv04_region.c
+++ b/src/mesa/drivers/dri/nouveau_winsys/nv04_surface.c
@@ -27,15 +27,15 @@ nv04_rect_format(int cpp)
}
static void
-nv04_region_copy_m2mf(struct nouveau_context *nv, unsigned dx, unsigned dy,
- unsigned sx, unsigned sy, unsigned w, unsigned h)
+nv04_surface_copy_m2mf(struct nouveau_context *nv, unsigned dx, unsigned dy,
+ unsigned sx, unsigned sy, unsigned w, unsigned h)
{
- struct pipe_region *dst = nv->region_dst;
- struct pipe_region *src = nv->region_dst;
+ struct pipe_surface *dst = nv->surf_dst;
+ struct pipe_surface *src = nv->surf_dst;
unsigned dst_offset, src_offset;
-
- dst_offset = nv->region_dst_offset + (dy * dst->pitch + dx) * dst->cpp;
- src_offset = nv->region_src_offset + (sy * src->pitch + sx) * src->cpp;
+
+ dst_offset = dst->offset + (dy * dst->pitch + dx) * dst->cpp;
+ src_offset = src->offset + (sy * src->pitch + sx) * src->cpp;
while (h) {
int count = (h > 2047) ? 2047 : h;
@@ -59,8 +59,8 @@ nv04_region_copy_m2mf(struct nouveau_context *nv, unsigned dx, unsigned dy,
}
static void
-nv04_region_copy_blit(struct nouveau_context *nv, unsigned dx, unsigned dy,
- unsigned sx, unsigned sy, unsigned w, unsigned h)
+nv04_surface_copy_blit(struct nouveau_context *nv, unsigned dx, unsigned dy,
+ unsigned sx, unsigned sy, unsigned w, unsigned h)
{
BEGIN_RING(NvImageBlit, 0x0300, 3);
OUT_RING ((sy << 16) | sx);
@@ -69,9 +69,8 @@ nv04_region_copy_blit(struct nouveau_context *nv, unsigned dx, unsigned dy,
}
static int
-nv04_region_copy_prep(struct nouveau_context *nv,
- struct pipe_region *dst, unsigned dst_offset,
- struct pipe_region *src, unsigned src_offset)
+nv04_surface_copy_prep(struct nouveau_context *nv, struct pipe_surface *dst,
+ struct pipe_surface *src)
{
int format;
@@ -81,18 +80,16 @@ nv04_region_copy_prep(struct nouveau_context *nv,
/* NV_CONTEXT_SURFACES_2D has buffer alignment restrictions, fallback
* to NV_MEMORY_TO_MEMORY_FORMAT in this case.
*/
- if ((src_offset & 63) || (dst_offset & 63)) {
+ if ((src->offset & 63) || (dst->offset & 63)) {
BEGIN_RING(NvM2MF, NV_MEMORY_TO_MEMORY_FORMAT_DMA_BUFFER_IN, 2);
OUT_RELOCo(src->buffer, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM |
NOUVEAU_BO_RD);
OUT_RELOCo(dst->buffer, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM |
NOUVEAU_BO_WR);
- nv->region_copy = nv04_region_copy_m2mf;
- nv->region_dst = dst;
- nv->region_dst_offset = dst_offset;
- nv->region_src = src;
- nv->region_src_offset = src_offset;
+ nv->surface_copy = nv04_surface_copy_m2mf;
+ nv->surf_dst = dst;
+ nv->surf_src = src;
return 0;
}
@@ -101,7 +98,7 @@ nv04_region_copy_prep(struct nouveau_context *nv,
NOUVEAU_ERR("Bad cpp = %d\n", dst->cpp);
return 1;
}
- nv->region_copy = nv04_region_copy_blit;
+ nv->surface_copy = nv04_surface_copy_blit;
BEGIN_RING(NvCtxSurf2D, NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2);
OUT_RELOCo(src->buffer, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
@@ -110,14 +107,14 @@ nv04_region_copy_prep(struct nouveau_context *nv,
BEGIN_RING(NvCtxSurf2D, NV04_CONTEXT_SURFACES_2D_FORMAT, 4);
OUT_RING (format);
OUT_RING (((dst->pitch * dst->cpp) << 16) | (src->pitch * src->cpp));
- OUT_RELOCl(src->buffer, src_offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
- OUT_RELOCl(dst->buffer, dst_offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+ OUT_RELOCl(src->buffer, src->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
+ OUT_RELOCl(dst->buffer, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
return 0;
}
static void
-nv04_region_copy_done(struct nouveau_context *nv)
+nv04_surface_copy_done(struct nouveau_context *nv)
{
nouveau_notifier_reset(nv->sync_notifier, 0);
BEGIN_RING(NvGdiRect, 0x104, 1);
@@ -129,10 +126,9 @@ nv04_region_copy_done(struct nouveau_context *nv)
}
static int
-nv04_region_fill(struct nouveau_context *nv,
- struct pipe_region *dst, unsigned dst_offset,
- unsigned dx, unsigned dy, unsigned w, unsigned h,
- unsigned value)
+nv04_surface_fill(struct nouveau_context *nv, struct pipe_surface *dst,
+ unsigned dx, unsigned dy, unsigned w, unsigned h,
+ unsigned value)
{
int cs2d_format, gdirect_format;
@@ -152,8 +148,8 @@ nv04_region_fill(struct nouveau_context *nv,
BEGIN_RING(NvCtxSurf2D, NV04_CONTEXT_SURFACES_2D_FORMAT, 4);
OUT_RING (cs2d_format);
OUT_RING (((dst->pitch * dst->cpp) << 16) | (dst->pitch * dst->cpp));
- OUT_RELOCl(dst->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
- OUT_RELOCl(dst->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+ OUT_RELOCl(dst->buffer, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+ OUT_RELOCl(dst->buffer, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
BEGIN_RING(NvGdiRect, NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT, 1);
OUT_RING (gdirect_format);
@@ -176,17 +172,16 @@ nv04_region_fill(struct nouveau_context *nv,
}
static int
-nv04_region_data(struct nouveau_context *nv, struct pipe_region *dst,
- unsigned dst_offset, unsigned dx, unsigned dy,
- const void *src, unsigned src_pitch,
- unsigned sx, unsigned sy, unsigned w, unsigned h)
+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_region_init_nv04(struct nouveau_context *nv)
+nouveau_surface_init_nv04(struct nouveau_context *nv)
{
unsigned class;
int ret;
@@ -239,11 +234,11 @@ nouveau_region_init_nv04(struct nouveau_context *nv)
BEGIN_RING(NvGdiRect, NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT, 1);
OUT_RING (NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT_LE);
- nv->region_copy_prep = nv04_region_copy_prep;
- nv->region_copy = nv04_region_copy_blit;
- nv->region_copy_done = nv04_region_copy_done;
- nv->region_fill = nv04_region_fill;
- nv->region_data = nv04_region_data;
+ nv->surface_copy_prep = nv04_surface_copy_prep;
+ 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;
}
diff --git a/src/mesa/drivers/dri/nouveau_winsys/nv50_region.c b/src/mesa/drivers/dri/nouveau_winsys/nv50_surface.c
index 168cbdfb7c..2525476a79 100644
--- a/src/mesa/drivers/dri/nouveau_winsys/nv50_region.c
+++ b/src/mesa/drivers/dri/nouveau_winsys/nv50_surface.c
@@ -16,9 +16,8 @@ nv50_format(int cpp)
}
static int
-nv50_region_copy_prep(struct nouveau_context *nv,
- struct pipe_region *dst, unsigned dst_offset,
- struct pipe_region *src, unsigned src_offset)
+nv50_surface_copy_prep(struct nouveau_context *nv,
+ struct pipe_surface *dst, struct pipe_surface *src)
{
int surf_format;
@@ -38,8 +37,8 @@ nv50_region_copy_prep(struct nouveau_context *nv,
OUT_RING (dst->pitch * dst->cpp);
OUT_RING (dst->pitch);
OUT_RING (dst->height);
- OUT_RELOCh(dst->buffer, dst_offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
- OUT_RELOCl(dst->buffer, dst_offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+ OUT_RELOCh(dst->buffer, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+ OUT_RELOCl(dst->buffer, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
BEGIN_RING(Nv2D, NV50_2D_CLIP_X, 4);
OUT_RING (0);
OUT_RING (0);
@@ -53,15 +52,15 @@ nv50_region_copy_prep(struct nouveau_context *nv,
OUT_RING (src->pitch * src->cpp);
OUT_RING (src->pitch);
OUT_RING (src->height);
- OUT_RELOCh(src->buffer, src_offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
- OUT_RELOCl(src->buffer, src_offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
+ OUT_RELOCh(src->buffer, src->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
+ OUT_RELOCl(src->buffer, src->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
return 0;
}
static void
-nv50_region_copy(struct nouveau_context *nv, unsigned dx, unsigned dy,
- unsigned sx, unsigned sy, unsigned w, unsigned h)
+nv50_surface_copy(struct nouveau_context *nv, unsigned dx, unsigned dy,
+ unsigned sx, unsigned sy, unsigned w, unsigned h)
{
BEGIN_RING(Nv2D, 0x0110, 1);
OUT_RING (0);
@@ -81,7 +80,7 @@ nv50_region_copy(struct nouveau_context *nv, unsigned dx, unsigned dy,
}
static void
-nv50_region_copy_done(struct nouveau_context *nv)
+nv50_surface_copy_done(struct nouveau_context *nv)
{
nouveau_notifier_reset(nv->sync_notifier, 0);
BEGIN_RING(Nv2D, 0x104, 1);
@@ -93,10 +92,9 @@ nv50_region_copy_done(struct nouveau_context *nv)
}
static int
-nv50_region_fill(struct nouveau_context *nv,
- struct pipe_region *dst, unsigned dst_offset,
- unsigned dx, unsigned dy, unsigned w, unsigned h,
- unsigned value)
+nv50_surface_fill(struct nouveau_context *nv, struct pipe_surface *dst,
+ unsigned dx, unsigned dy, unsigned w, unsigned h,
+ unsigned value)
{
int surf_format, rect_format;
@@ -117,8 +115,8 @@ nv50_region_fill(struct nouveau_context *nv,
OUT_RING (dst->pitch * dst->cpp);
OUT_RING (dst->pitch);
OUT_RING (dst->height);
- OUT_RELOCh(dst->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
- OUT_RELOCl(dst->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+ OUT_RELOCh(dst->buffer, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+ OUT_RELOCl(dst->buffer, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
BEGIN_RING(Nv2D, NV50_2D_CLIP_X, 4);
OUT_RING (0);
OUT_RING (0);
@@ -148,17 +146,16 @@ nv50_region_fill(struct nouveau_context *nv,
}
static int
-nv50_region_data(struct nouveau_context *nv, struct pipe_region *dst,
- unsigned dst_offset, unsigned dx, unsigned dy,
- const void *src, unsigned src_pitch,
- unsigned sx, unsigned sy, unsigned w, unsigned h)
+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_region_init_nv50(struct nouveau_context *nv)
+nouveau_surface_init_nv50(struct nouveau_context *nv)
{
int ret;
@@ -175,11 +172,11 @@ nouveau_region_init_nv50(struct nouveau_context *nv)
BEGIN_RING(Nv2D, NV50_2D_OPERATION, 1);
OUT_RING (NV50_2D_OPERATION_SRCCOPY);
- nv->region_copy_prep = nv50_region_copy_prep;
- nv->region_copy = nv50_region_copy;
- nv->region_copy_done = nv50_region_copy_done;
- nv->region_fill = nv50_region_fill;
- nv->region_data = nv50_region_data;
+ nv->surface_copy_prep = nv50_surface_copy_prep;
+ 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;
}