Merge remote-tracking branch 'origin/master' into vulkan
[mesa.git] / src / gallium / drivers / nouveau / nv50 / nv50_transfer.c
index be514077d32606adae32f7bf3417ea6963657b12..86a8c15946989355ef174c5b026f624c5303599b 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "nv50/nv50_context.h"
 
-#include "nv50/nv50_defs.xml.h"
+#include "nv50/g80_defs.xml.h"
 
 struct nv50_transfer {
    struct pipe_transfer base;
@@ -163,7 +163,7 @@ nv50_sifc_linear_u8(struct nouveau_context *nv,
    offset &= ~0xff;
 
    BEGIN_NV04(push, NV50_2D(DST_FORMAT), 2);
-   PUSH_DATA (push, NV50_SURFACE_FORMAT_R8_UNORM);
+   PUSH_DATA (push, G80_SURFACE_FORMAT_R8_UNORM);
    PUSH_DATA (push, 1);
    BEGIN_NV04(push, NV50_2D(DST_PITCH), 5);
    PUSH_DATA (push, 262144);
@@ -173,7 +173,7 @@ nv50_sifc_linear_u8(struct nouveau_context *nv,
    PUSH_DATA (push, dst->offset + offset);
    BEGIN_NV04(push, NV50_2D(SIFC_BITMAP_ENABLE), 2);
    PUSH_DATA (push, 0);
-   PUSH_DATA (push, NV50_SURFACE_FORMAT_R8_UNORM);
+   PUSH_DATA (push, G80_SURFACE_FORMAT_R8_UNORM);
    BEGIN_NV04(push, NV50_2D(SIFC_WIDTH), 10);
    PUSH_DATA (push, size);
    PUSH_DATA (push, 1);
@@ -187,14 +187,7 @@ nv50_sifc_linear_u8(struct nouveau_context *nv,
    PUSH_DATA (push, 0);
 
    while (count) {
-      unsigned nr;
-
-      if (!PUSH_SPACE(push, 16))
-         break;
-      nr = PUSH_AVAIL(push);
-      assert(nr >= 16);
-      nr = MIN2(count, nr - 1);
-      nr = MIN2(nr, NV04_PFIFO_MAX_PACKET_LEN);
+      unsigned nr = MIN2(count, NV04_PFIFO_MAX_PACKET_LEN);
 
       BEGIN_NI04(push, NV50_2D(SIFC_DATA), nr);
       PUSH_DATAp(push, src, nr);
@@ -395,12 +388,9 @@ nv50_cb_push(struct nouveau_context *nv,
    nouveau_pushbuf_validate(push);
 
    while (words) {
-      unsigned nr;
-
-      nr = PUSH_AVAIL(push);
-      nr = MIN2(nr - 7, words);
-      nr = MIN2(nr, NV04_PFIFO_MAX_PACKET_LEN - 1);
+      unsigned nr = MIN2(words, NV04_PFIFO_MAX_PACKET_LEN);
 
+      PUSH_SPACE(push, nr + 7);
       BEGIN_NV04(push, NV50_3D(CB_DEF_ADDRESS_HIGH), 3);
       PUSH_DATAh(push, bo->offset + base);
       PUSH_DATA (push, bo->offset + base);