nv50: RCP and RSQ cannot load from VP inputs
[mesa.git] / src / gallium / drivers / nv50 / nv50_surface.c
index 31c36a12b73319273a4878b90eff30ec1550ceac..6bf6f773b0c26b075282175c1d3292a1e3ddd753 100644 (file)
@@ -53,20 +53,20 @@ nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst)
        struct nv50_miptree *mt = nv50_miptree(ps->texture);
        struct nouveau_channel *chan = screen->eng2d->channel;
        struct nouveau_grobj *eng2d = screen->eng2d;
-       struct nouveau_bo *bo = nv50_miptree(ps->texture)->bo;
+       struct nouveau_bo *bo = nv50_miptree(ps->texture)->base.bo;
        int format, mthd = dst ? NV50_2D_DST_FORMAT : NV50_2D_SRC_FORMAT;
        int flags = NOUVEAU_BO_VRAM | (dst ? NOUVEAU_BO_WR : NOUVEAU_BO_RD);
 
        format = nv50_format(ps->format);
        if (format < 0)
                return 1;
-  
+
        if (!bo->tile_flags) {
                BEGIN_RING(chan, eng2d, mthd, 2);
                OUT_RING  (chan, format);
                OUT_RING  (chan, 1);
                BEGIN_RING(chan, eng2d, mthd + 0x14, 5);
-               OUT_RING  (chan, mt->level[0].pitch);
+               OUT_RING  (chan, mt->level[ps->level].pitch);
                OUT_RING  (chan, ps->width);
                OUT_RING  (chan, ps->height);
                OUT_RELOCh(chan, bo, ps->offset, flags);
@@ -75,7 +75,7 @@ nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst)
                BEGIN_RING(chan, eng2d, mthd, 5);
                OUT_RING  (chan, format);
                OUT_RING  (chan, 0);
-               OUT_RING  (chan, bo->tile_mode << 4);
+               OUT_RING  (chan, mt->level[ps->level].tile_mode << 4);
                OUT_RING  (chan, 1);
                OUT_RING  (chan, 0);
                BEGIN_RING(chan, eng2d, mthd + 0x18, 4);
@@ -144,7 +144,7 @@ nv50_surface_copy(struct pipe_context *pipe,
                  struct pipe_surface *src, unsigned srcx, unsigned srcy,
                  unsigned width, unsigned height)
 {
-       struct nv50_context *nv50 = (struct nv50_context *)pipe;
+       struct nv50_context *nv50 = nv50_context(pipe);
        struct nv50_screen *screen = nv50->screen;
 
        assert(src->format == dest->format);
@@ -158,7 +158,7 @@ nv50_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest,
                  unsigned destx, unsigned desty, unsigned width,
                  unsigned height, unsigned value)
 {
-       struct nv50_context *nv50 = (struct nv50_context *)pipe;
+       struct nv50_context *nv50 = nv50_context(pipe);
        struct nv50_screen *screen = nv50->screen;
        struct nouveau_channel *chan = screen->eng2d->channel;
        struct nouveau_grobj *eng2d = screen->eng2d;