summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvfx
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2010-05-17 21:28:14 +0200
committerRoland Scheidegger <[email protected]>2010-05-17 21:28:14 +0200
commitb59b23a51dc17da59ccff0b3f8a73009056746e5 (patch)
tree766f29aef605a90ff9ec61535ba761d857e79537 /src/gallium/drivers/nvfx
parent433701a7214fb792c3e8bdd71a0d025c09328f87 (diff)
nouveau: adapt to interface changes
this probably needs further cleanup (just getting a surface for the resource seems quite nonoptimal and potentially cause unnecessary copies I think)
Diffstat (limited to 'src/gallium/drivers/nvfx')
-rw-r--r--src/gallium/drivers/nvfx/nv04_surface_2d.c9
-rw-r--r--src/gallium/drivers/nvfx/nvfx_miptree.c2
-rw-r--r--src/gallium/drivers/nvfx/nvfx_screen.c4
-rw-r--r--src/gallium/drivers/nvfx/nvfx_surface.c37
-rw-r--r--src/gallium/drivers/nvfx/nvfx_transfer.c6
5 files changed, 40 insertions, 18 deletions
diff --git a/src/gallium/drivers/nvfx/nv04_surface_2d.c b/src/gallium/drivers/nvfx/nv04_surface_2d.c
index 4ed574227d6..7acbb505df3 100644
--- a/src/gallium/drivers/nvfx/nv04_surface_2d.c
+++ b/src/gallium/drivers/nvfx/nv04_surface_2d.c
@@ -502,12 +502,9 @@ nv04_surface_wrap_for_render(struct pipe_screen *pscreen,
struct nv04_surface* temp_ns;
int temp_flags;
- temp_flags = (ns->base.usage |
- PIPE_BIND_BLIT_SOURCE |
- PIPE_BIND_BLIT_DESTINATION);
+ temp_flags = ns->base.usage;
- ns->base.usage = (PIPE_BIND_BLIT_SOURCE |
- PIPE_BIND_BLIT_DESTINATION);
+ ns->base.usage = 0;
memset(&templ, 0, sizeof(templ));
templ.format = ns->base.texture->format;
@@ -526,7 +523,7 @@ nv04_surface_wrap_for_render(struct pipe_screen *pscreen,
temp_ns = (struct nv04_surface*)pscreen->get_tex_surface(pscreen, temp_tex, 0, 0, 0, temp_flags);
temp_ns->backing = ns;
- if(ns->base.usage & PIPE_BIND_BLIT_SOURCE)
+ if(1) /* hmm */
eng2d->copy(eng2d, &temp_ns->backing->base,
0, 0, &ns->base,
0, 0, ns->base.width, ns->base.height);
diff --git a/src/gallium/drivers/nvfx/nvfx_miptree.c b/src/gallium/drivers/nvfx/nvfx_miptree.c
index aeb88e9ac96..b5639bb4645 100644
--- a/src/gallium/drivers/nvfx/nvfx_miptree.c
+++ b/src/gallium/drivers/nvfx/nvfx_miptree.c
@@ -300,7 +300,7 @@ nvfx_miptree_surface_del(struct pipe_surface *ps)
if(ns->backing)
{
struct nvfx_screen* screen = (struct nvfx_screen*)ps->texture->screen;
- if(ns->backing->base.usage & PIPE_BIND_BLIT_DESTINATION)
+ if(1 /*ns->backing->base.usage & PIPE_BIND_BLIT_DESTINATION*/)
screen->eng2d->copy(screen->eng2d, &ns->backing->base, 0, 0, ps, 0, 0, ns->base.width, ns->base.height);
nvfx_miptree_surface_del(&ns->backing->base);
}
diff --git a/src/gallium/drivers/nvfx/nvfx_screen.c b/src/gallium/drivers/nvfx/nvfx_screen.c
index 9f03ab1833b..1786af776aa 100644
--- a/src/gallium/drivers/nvfx/nvfx_screen.c
+++ b/src/gallium/drivers/nvfx/nvfx_screen.c
@@ -115,11 +115,15 @@ static boolean
nvfx_screen_surface_format_supported(struct pipe_screen *pscreen,
enum pipe_format format,
enum pipe_texture_target target,
+ unsigned sample_count,
unsigned tex_usage, unsigned geom_flags)
{
struct nvfx_screen *screen = nvfx_screen(pscreen);
struct pipe_surface *front = ((struct nouveau_winsys *) pscreen->winsys)->front;
+ if (sample_count > 1)
+ return FALSE;
+
if (tex_usage & PIPE_BIND_RENDER_TARGET) {
switch (format) {
case PIPE_FORMAT_B8G8R8A8_UNORM:
diff --git a/src/gallium/drivers/nvfx/nvfx_surface.c b/src/gallium/drivers/nvfx/nvfx_surface.c
index 2e115650aeb..fc3a670d400 100644
--- a/src/gallium/drivers/nvfx/nvfx_surface.c
+++ b/src/gallium/drivers/nvfx/nvfx_surface.c
@@ -27,35 +27,54 @@
**************************************************************************/
#include "nvfx_context.h"
+#include "nvfx_resource.h"
#include "pipe/p_defines.h"
#include "util/u_inlines.h"
static void
nvfx_surface_copy(struct pipe_context *pipe,
- struct pipe_surface *dest, unsigned destx, unsigned desty,
- struct pipe_surface *src, unsigned srcx, unsigned srcy,
+ struct pipe_resource *dest, struct pipe_subresource subdst,
+ unsigned destx, unsigned desty, unsigned destz,
+ struct pipe_resource *src, struct pipe_subresource subsrc,
+ unsigned srcx, unsigned srcy, unsigned srcz,
unsigned width, unsigned height)
{
struct nvfx_context *nvfx = nvfx_context(pipe);
struct nv04_surface_2d *eng2d = nvfx->screen->eng2d;
+ struct pipe_surface *ps_dst, *ps_src;
- eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height);
+ ps_src = nvfx_miptree_surface_new(pipe->screen, dest, subsrc.face,
+ subsrc.level, srcz, 0 /* bind flags */);
+ ps_dst = nvfx_miptree_surface_new(pipe->screen, dest, subdst.face,
+ subdst.level, destz, 0 /* bindflags */);
+
+ eng2d->copy(eng2d, ps_dst, destx, desty, ps_src, srcx, srcy, width, height);
+
+ nvfx_miptree_surface_del(ps_src);
+ nvfx_miptree_surface_del(ps_dst);
}
static void
-nvfx_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest,
- unsigned destx, unsigned desty, unsigned width,
- unsigned height, unsigned value)
+nvfx_surface_fill(struct pipe_context *pipe, struct pipe_resource *dest,
+ struct pipe_subresource subdst,
+ unsigned destx, unsigned desty, unsigned destz,
+ unsigned width, unsigned height, unsigned value)
{
struct nvfx_context *nvfx = nvfx_context(pipe);
+ struct pipe_surface *ps;
struct nv04_surface_2d *eng2d = nvfx->screen->eng2d;
- eng2d->fill(eng2d, dest, destx, desty, width, height, value);
+ ps = nvfx_miptree_surface_new(pipe->screen, dest, subdst.face,
+ subdst.level, destz, 0 /* bind flags */);
+
+ eng2d->fill(eng2d, ps, destx, desty, width, height, value);
+
+ nvfx_miptree_surface_del(ps);
}
void
nvfx_init_surface_functions(struct nvfx_context *nvfx)
{
- nvfx->pipe.surface_copy = nvfx_surface_copy;
- nvfx->pipe.surface_fill = nvfx_surface_fill;
+ nvfx->pipe.resource_copy_region = nvfx_surface_copy;
+ nvfx->pipe.resource_fill_region = nvfx_surface_fill;
}
diff --git a/src/gallium/drivers/nvfx/nvfx_transfer.c b/src/gallium/drivers/nvfx/nvfx_transfer.c
index b2ef27cf579..9ff0a93d307 100644
--- a/src/gallium/drivers/nvfx/nvfx_transfer.c
+++ b/src/gallium/drivers/nvfx/nvfx_transfer.c
@@ -40,11 +40,13 @@ static unsigned nvfx_transfer_bind_flags( unsigned transfer_usage )
{
unsigned bind = 0;
+#if 0
if (transfer_usage & PIPE_TRANSFER_WRITE)
bind |= PIPE_BIND_BLIT_SOURCE;
if (transfer_usage & PIPE_TRANSFER_READ)
bind |= PIPE_BIND_BLIT_DESTINATION;
+#endif
return bind;
}
@@ -128,7 +130,7 @@ nvfx_miptree_transfer_new(struct pipe_context *pipe,
src = pscreen->get_tex_surface(pscreen, pt,
sr.face, sr.level, box->z,
- PIPE_BIND_BLIT_SOURCE);
+ 0 /*PIPE_BIND_BLIT_SOURCE*/);
/* TODO: Check if SIFM can deal with x,y,w,h when swizzling */
/* TODO: Check if SIFM can un-swizzle */
@@ -160,7 +162,7 @@ nvfx_miptree_transfer_del(struct pipe_context *pipe,
ptx->sr.face,
ptx->sr.level,
ptx->box.z,
- PIPE_BIND_BLIT_DESTINATION);
+ 0 /*PIPE_BIND_BLIT_DESTINATION*/);
/* TODO: Check if SIFM can deal with x,y,w,h when swizzling */
nvscreen->eng2d->copy(nvscreen->eng2d,