All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nv50: enable texture compression
@ 2015-01-02  2:56 Tobias Klausmann
       [not found] ` <1420167363-3297-1-git-send-email-tobias.johannes.klausmann-AqjdNwhu20eELgA04lAiVw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Tobias Klausmann @ 2015-01-02  2:56 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

We enable compression only for some supported formats

Suggested-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
---
 src/gallium/drivers/nouveau/nv50/nv50_miptree.c |  4 ++--
 src/gallium/drivers/nouveau/nv50/nv50_screen.c  | 11 +++++++++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
index 1aacaec..a40e6d3 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
@@ -65,8 +65,7 @@ nv50_tex_choose_tile_dims(unsigned nx, unsigned ny, unsigned nz)
 static uint32_t
 nv50_mt_choose_storage_type(struct nv50_miptree *mt, boolean compressed)
 {
-   const unsigned ms = mt->ms_x + mt->ms_y;
-
+   const unsigned ms = util_logbase2(mt->base.base.nr_samples);
    uint32_t tile_flags;
 
    if (unlikely(mt->base.base.flags & NOUVEAU_RESOURCE_FLAG_LINEAR))
@@ -96,6 +95,7 @@ nv50_mt_choose_storage_type(struct nv50_miptree *mt, boolean compressed)
       tile_flags = 0x60 + ms;
       break;
    default:
+      compressed = false;
       switch (util_format_get_blocksizebits(mt->base.base.format)) {
       case 128:
          assert(ms < 3);
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
index 2d8347b..8d759a7 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
@@ -391,7 +391,7 @@ nv50_screen_fence_update(struct pipe_screen *pscreen)
 }
 
 static void
-nv50_screen_init_hwctx(struct nv50_screen *screen)
+nv50_screen_init_hwctx(struct nouveau_device *dev, struct nv50_screen *screen)
 {
    struct nouveau_pushbuf *push = screen->base.pushbuf;
    struct nv04_fifo *fifo;
@@ -449,6 +449,13 @@ nv50_screen_init_hwctx(struct nv50_screen *screen)
       PUSH_DATA (push, 0x18);
    }
 
+   BEGIN_NV04(push, NV50_3D(ZETA_COMP_ENABLE), 1);
+   PUSH_DATA(push, dev->drm_version >= 0x01000101);
+
+   BEGIN_NV04(push, NV50_3D(RT_COMP_ENABLE(0)), 8);
+   for (i = 0; i < 8; ++i)
+      PUSH_DATA(push, dev->drm_version >= 0x01000101);
+
    BEGIN_NV04(push, NV50_3D(RT_CONTROL), 1);
    PUSH_DATA (push, 1);
 
@@ -871,7 +878,7 @@ nv50_screen_create(struct nouveau_device *dev)
    if (!nv50_blitter_create(screen))
       goto fail;
 
-   nv50_screen_init_hwctx(screen);
+   nv50_screen_init_hwctx(dev, screen);
 
    nouveau_fence_new(&screen->base, &screen->base.fence.current, FALSE);
 
-- 
2.2.1

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-01-03  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-02  2:56 [PATCH] nv50: enable texture compression Tobias Klausmann
     [not found] ` <1420167363-3297-1-git-send-email-tobias.johannes.klausmann-AqjdNwhu20eELgA04lAiVw@public.gmane.org>
2015-01-02  3:26   ` Ilia Mirkin
     [not found]     ` <CAKb7UviwHNX-+bvzrafi13dnsJdm1fiA95miPTGdgTn7Oh_9kg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-02 23:09       ` [PATCH v2] " Tobias Klausmann
     [not found]         ` <1420240193-16070-1-git-send-email-tobias.johannes.klausmann-AqjdNwhu20eELgA04lAiVw@public.gmane.org>
2015-01-02 23:20           ` Ilia Mirkin
     [not found]             ` <CAKb7UviGAYm-mfT7DyZ-5iFW1V=hyAR8GqfZ=rNFMV0pVJ0Ggw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-02 23:50               ` Tobias Klausmann
     [not found]                 ` <54A72EDD.8020501-AqjdNwhu20eELgA04lAiVw@public.gmane.org>
2015-01-03  0:00                   ` [PATCH v3] " Tobias Klausmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.