Re: [Mesa-dev] [PATCH v2 1/2] mesa: add GL_OES_texture_border_clamp support
On Fri, 2016-02-19 at 09:07 -0500, Ilia Mirkin wrote: > On Feb 19, 2016 8:05 AM, "Samuel Iglesias Gonsálvez" a.com> wrote: > > > > On Wed, Feb 17, 2016 at 08:46:36PM -0500, Ilia Mirkin wrote: > > > Only minor differences to the existing ARB_texture_border_clamp > support. > > > > > > Signed-off-by: Ilia Mirkin > > > --- > > > > > > v1 -> v2: added a patch to add the EXT version of this extension > > > > > > docs/GL3.txt | 2 +- > > > src/mapi/glapi/gen/es_EXT.xml | 58 > - > > > src/mesa/main/extensions_table.h | 1 + > > > src/mesa/main/samplerobj.c | 6 ++-- > > > src/mesa/main/tests/dispatch_sanity.cpp | 10 ++ > > > src/mesa/main/texparam.c | 11 --- > > > 6 files changed, 80 insertions(+), 8 deletions(-) > > > > > > diff --git a/docs/GL3.txt b/docs/GL3.txt > > > index ea7ceef..0957247 100644 > > > --- a/docs/GL3.txt > > > +++ b/docs/GL3.txt > > > @@ -253,7 +253,7 @@ GLES3.2, GLSL ES 3.2 > > > GL_OES_shader_io_blocks not > started (based on parts of GLSL 1.50, which is done) > > > GL_OES_shader_multisample_interpolation not > started (based on parts of GL_ARB_gpu_shader5, which is done) > > > GL_OES_tessellation_shader not > started (based on GL_ARB_tessellation_shader, which is done for some > drivers) > > > - GL_OES_texture_border_clamp not > started (based on GL_ARB_texture_border_clamp, which is done) > > > + GL_OES_texture_border_clamp DONE (all > drivers) > > > GL_OES_texture_buffer not > started (based on GL_ARB_texture_buffer_object, > GL_ARB_texture_buffer_range, and GL_ARB_texture_buffer_object_rgb32 > that are all done) > > > GL_OES_texture_cube_map_array not > started (based on GL_ARB_texture_cube_map_array, which is done for > all drivers) > > > GL_OES_texture_stencil8 not > started (based on GL_ARB_texture_stencil8, which is done for some > drivers) > > > diff --git a/src/mapi/glapi/gen/es_EXT.xml > b/src/mapi/glapi/gen/es_EXT.xml > > > index 86df980..fb0ef05 100644 > > > --- a/src/mapi/glapi/gen/es_EXT.xml > > > +++ b/src/mapi/glapi/gen/es_EXT.xml > > > @@ -982,5 +982,61 @@ > > > > > > > > > > > > - > > > + > > > + > > > + > > > + > > > + > > > + > > > + > > > + alias="TexParameterIiv"> > > > > I have a doubt here that it is repeated along this patch and the > following one... > > Shouldn't it be es2="3.2"? Because the extension was in core in > OpenGL ES 3.2. > That's not what this means... It might be core in gles 100, but > the entrypoint should be exposed in gles3. The ext itself is > available starting gles2, but int formats only became available in > gles3, and this entrypoint only applies to int color formats. > -ilia Right, thanks! This series is: Reviewed-by: Samuel Iglesias Gonsálvez Sam ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] change 396cbab, configs with accumulation buffer
Hi Marek; Was this commit fixing some issues/problems? Why would we not expose configs with accumulation buffer? --- 8< --- commit 396cbabbefaae64deac6d33c79898bb07db8a621 Author: Marek Olšák Date: Thu Apr 9 23:25:07 2015 +0200 egl/dri: don't expose configs with an accumulation buffer --- 8< --- Thanks; // Tapani ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2] egl: support EGL_LARGEST_PBUFFER in eglCreatePbufferSurface(...)
From: Daniel Czarnowski Patch provides a default for a set pbuffer surface size when EGL_LARGEST_PBUFFER is used by the client. MIN2 macro is moved to egldefines so that it can be shared. Fixes following Piglit test: egl-create-largest-pbuffer-surface From EGL 1.5 spec: "Use EGL_LARGEST_PBUFFER to get the largest available pbuffer when the allocation of the pbuffer would otherwise fail." Currently there exists no API to query largest available pixmap size using xlib or xcb so right now this seems most straightforward way to ensure that we fulfill above API and also we don't attempt to allocate 'too big' pixmap which might succeed on server side but not work in practice when driver starts to use it as a texture. v2: add more explanation about the change (Emil) Signed-off-by: Matt Roper Cc: "11.0 11.1" LargestPbuffer) { + surf->Width = MIN2(surf->Width, _EGL_MAX_PBUFFER_WIDTH); + surf->Height = MIN2(surf->Height, _EGL_MAX_PBUFFER_HEIGHT); + } + return EGL_TRUE; } -- 2.5.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] abundance of branches in mesa.git
Brian Paul writes: > On Sat, Feb 20, 2016 at 2:41 PM, Jason Ekstrand > wrote: > >> >> On Feb 20, 2016 1:19 PM, "Rob Clark" wrote: >> > >> > fwiw, I think a *small* number of topic branches in certain cases >> > makes sense.. I'm definitely in support of a TTL limit (ie. >> > automatically nuke topic branches with no activity in N months, or >> > similar..) >> >> I agree. Sometimes something big comes up that's not ready for merging >> such as amdgpu or our recently pushed Vulkan driver. However, those should >> only be temporary and removed once the work is complete. I saw a >> "broadwell" branch in there which is probably at least 2 years old and >> completely subsumed by master. We don't want to be archiving random junk >> in the main tree. >> >> I'd be fine with a timeout system where non-release branches get the boot >> after a certain amount inactivity. If you want to archive something, that's >> what personal git repos are for. >> > > I'm OK with deleting old branches too. > > I don't know much about git under the hood- would deleting old branches > actually delete the objects on those branches and make the database > smaller? If so, I'm guessing it probably wouldn't amount to much. People pulling down the repository fresh wouldn't get any objects that existed only in the old branches. For those of us with existing clones, the tracking branch would stay around until we do a git prune, and then the objects would stay around until git gc. There's an argument for keeping branches that aren't merged, in case someone wants to pick the work back up again. But then, almost all branches of that type are in personal repositories, anyway. I wouldn't miss topic branches that have been left around in the main tree. signature.asc Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] anv: enable symbol visibility.
On Sun, Feb 21, 2016 at 5:17 PM, Dave Airlie wrote: > From: Dave Airlie > > This drops the amount of symbols visible down, vulkaninfo/vkcube > still execute. Thanks. It was always the intention to use this, but I guess we forgot to turn it on. Reviewed-by: Kristian Høgsberg > --- > src/intel/isl/Makefile.am| 1 + > src/intel/vulkan/Makefile.am | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/src/intel/isl/Makefile.am b/src/intel/isl/Makefile.am > index 72f5460..8f812d0 100644 > --- a/src/intel/isl/Makefile.am > +++ b/src/intel/isl/Makefile.am > @@ -29,6 +29,7 @@ EXTRA_DIST = tests > AM_CPPFLAGS = \ > $(INTEL_CFLAGS) \ > $(VALGRIND_CFLAGS) \ > + $(VISIBILITY_CFLAGS) \ > $(DEFINES) \ > -I$(top_srcdir)/include \ > -I$(top_srcdir)/src \ > diff --git a/src/intel/vulkan/Makefile.am b/src/intel/vulkan/Makefile.am > index 6be4f9f..a343a4d 100644 > --- a/src/intel/vulkan/Makefile.am > +++ b/src/intel/vulkan/Makefile.am > @@ -51,6 +51,7 @@ noinst_LTLIBRARIES = $(PER_GEN_LIBS) > AM_CPPFLAGS = \ > $(INTEL_CFLAGS) \ > $(VALGRIND_CFLAGS) \ > + $(VISIBILITY_CFLAGS) \ > $(DEFINES) \ > -I$(top_srcdir)/include \ > -I$(top_srcdir)/src \ > -- > 2.5.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] anv: enable symbol visibility.
On Sun, Feb 21, 2016 at 5:17 PM, Dave Airlie wrote: > From: Dave Airlie > > This drops the amount of symbols visible down, vulkaninfo/vkcube > still execute. > --- > src/intel/isl/Makefile.am| 1 + > src/intel/vulkan/Makefile.am | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/src/intel/isl/Makefile.am b/src/intel/isl/Makefile.am > index 72f5460..8f812d0 100644 > --- a/src/intel/isl/Makefile.am > +++ b/src/intel/isl/Makefile.am > @@ -29,6 +29,7 @@ EXTRA_DIST = tests > AM_CPPFLAGS = \ > $(INTEL_CFLAGS) \ > $(VALGRIND_CFLAGS) \ > + $(VISIBILITY_CFLAGS) \ > $(DEFINES) \ > -I$(top_srcdir)/include \ > -I$(top_srcdir)/src \ > diff --git a/src/intel/vulkan/Makefile.am b/src/intel/vulkan/Makefile.am > index 6be4f9f..a343a4d 100644 > --- a/src/intel/vulkan/Makefile.am > +++ b/src/intel/vulkan/Makefile.am > @@ -51,6 +51,7 @@ noinst_LTLIBRARIES = $(PER_GEN_LIBS) > AM_CPPFLAGS = \ > $(INTEL_CFLAGS) \ > $(VALGRIND_CFLAGS) \ > + $(VISIBILITY_CFLAGS) \ > $(DEFINES) \ > -I$(top_srcdir)/include \ > -I$(top_srcdir)/src \ > -- > 2.5.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] anv: enable symbol visibility.
From: Dave Airlie This drops the amount of symbols visible down, vulkaninfo/vkcube still execute. --- src/intel/isl/Makefile.am| 1 + src/intel/vulkan/Makefile.am | 1 + 2 files changed, 2 insertions(+) diff --git a/src/intel/isl/Makefile.am b/src/intel/isl/Makefile.am index 72f5460..8f812d0 100644 --- a/src/intel/isl/Makefile.am +++ b/src/intel/isl/Makefile.am @@ -29,6 +29,7 @@ EXTRA_DIST = tests AM_CPPFLAGS = \ $(INTEL_CFLAGS) \ $(VALGRIND_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ $(DEFINES) \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src \ diff --git a/src/intel/vulkan/Makefile.am b/src/intel/vulkan/Makefile.am index 6be4f9f..a343a4d 100644 --- a/src/intel/vulkan/Makefile.am +++ b/src/intel/vulkan/Makefile.am @@ -51,6 +51,7 @@ noinst_LTLIBRARIES = $(PER_GEN_LIBS) AM_CPPFLAGS = \ $(INTEL_CFLAGS) \ $(VALGRIND_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ $(DEFINES) \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src \ -- 2.5.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 4/6] nvc0: introduce a flushed flag for compute validation path
On Sun, Feb 21, 2016 at 9:19 AM, Samuel Pitoiset wrote: > Signed-off-by: Samuel Pitoiset > --- > src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 4 +++- > src/gallium/drivers/nouveau/nvc0/nvc0_context.c | 4 +++- > src/gallium/drivers/nouveau/nvc0/nvc0_screen.h | 1 + > src/gallium/drivers/nouveau/nvc0/nve4_compute.c | 4 +++- > 4 files changed, 10 insertions(+), 3 deletions(-) > > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c > b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c > index 0717583..f76a10c 100644 > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c > @@ -281,8 +281,10 @@ nvc0_compute_state_validate(struct nvc0_context *nvc0) > nouveau_pushbuf_bufctx(nvc0->base.pushbuf, nvc0->bufctx_cp); > if (unlikely(nouveau_pushbuf_validate(nvc0->base.pushbuf))) >return false; > - if (unlikely(nvc0->state.flushed_3d)) > + if (unlikely(nvc0->state.flushed_cp)) { > + nvc0->state.flushed_cp = false; >nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, true); > + } > > return true; > > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c > b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c > index 683fc20..cfd4cab 100644 > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c > @@ -176,8 +176,10 @@ nvc0_default_kick_notify(struct nouveau_pushbuf *push) > if (screen) { >nouveau_fence_next(&screen->base); >nouveau_fence_update(&screen->base, true); > - if (screen->cur_ctx) > + if (screen->cur_ctx) { > screen->cur_ctx->state.flushed_3d = true; > + screen->cur_ctx->state.flushed_cp = true; I think that this basically makes it meaningless to have two separate flags. This whole flushed thing is pretty confusing... please think about how and why it exists, and then document it :) I don't fully remember TBH. I think it has to do with not wanting to flush at the end of every draw, but handling the case where a flush happens in the middle of a draw (which means that a fence most likely went by and all the current draw's objects need to be fenced on the new upcoming fence). Or something. I don't think having a separate one for compute makes sense. Although it's entirely possible that the way it's currently handled in compute is buggy. -ilia > + } >NOUVEAU_DRV_STAT(&screen->base, pushbuf_count, 1); > } > } > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h > b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h > index 9a58da5..f47beee 100644 > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h > @@ -31,6 +31,7 @@ struct nvc0_blitter; > > struct nvc0_graph_state { > bool flushed_3d; > + bool flushed_cp; > bool rasterizer_discard; > bool early_z_forced; > bool prim_restart; > diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c > b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c > index e33458b..fae8c60 100644 > --- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c > +++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c > @@ -338,8 +338,10 @@ nve4_compute_state_validate(struct nvc0_context *nvc0) > nouveau_pushbuf_bufctx(nvc0->base.pushbuf, nvc0->bufctx_cp); > if (unlikely(nouveau_pushbuf_validate(nvc0->base.pushbuf))) >return false; > - if (unlikely(nvc0->state.flushed_3d)) > + if (unlikely(nvc0->state.flushed_cp)) { > + nvc0->state.flushed_cp = false; >nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, true); > + } > > return true; > } > -- > 2.6.4 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/6] nvc0: rework nvc0_compute_validate_program()
On 02/22/2016 12:19 AM, Ilia Mirkin wrote: Should you instead move nvc0_compute_validate into nvc0_shader_state? Currently that's where all this stuff lives. I see nvc0_program_validate as more of an "internal" module function that shouldn't be exported across files. Fine by me. On Sun, Feb 21, 2016 at 9:19 AM, Samuel Pitoiset wrote: Reduce the amount of duplicated code by re-using nvc0_program_validate(). While we are at it, change the prototype to return void. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c| 32 ++ src/gallium/drivers/nouveau/nvc0/nvc0_compute.h| 4 +-- src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 1 + .../drivers/nouveau/nvc0/nvc0_shader_state.c | 2 +- src/gallium/drivers/nouveau/nvc0/nve4_compute.c| 3 +- 5 files changed, 13 insertions(+), 29 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index 0f1265f..491221e 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -120,32 +120,17 @@ nvc0_screen_compute_setup(struct nvc0_screen *screen, return 0; } -bool +void nvc0_compute_validate_program(struct nvc0_context *nvc0) { - struct nvc0_program *prog = nvc0->compprog; - - if (prog->mem) - return true; + struct nouveau_pushbuf *push = nvc0->base.pushbuf; + struct nvc0_program *cp = nvc0->compprog; - if (!prog->translated) { - prog->translated = nvc0_program_translate( - prog, nvc0->screen->base.device->chipset, &nvc0->base.debug); - if (!prog->translated) - return false; - } - if (unlikely(!prog->code_size)) - return false; + if (cp && !nvc0_program_validate(nvc0, cp)) + return; - if (likely(prog->code_size)) { - if (nvc0_program_upload_code(nvc0, prog)) { - struct nouveau_pushbuf *push = nvc0->base.pushbuf; - BEGIN_NVC0(push, NVC0_CP(FLUSH), 1); - PUSH_DATA (push, NVC0_COMPUTE_FLUSH_CODE); - return true; - } - } - return false; + BEGIN_NVC0(push, NVC0_CP(FLUSH), 1); + PUSH_DATA (push, NVC0_COMPUTE_FLUSH_CODE); } static void @@ -277,8 +262,7 @@ nvc0_compute_validate_buffers(struct nvc0_context *nvc0) static bool nvc0_compute_state_validate(struct nvc0_context *nvc0) { - if (!nvc0_compute_validate_program(nvc0)) - return false; + nvc0_compute_validate_program(nvc0); if (nvc0->dirty_cp & NVC0_NEW_CP_CONSTBUF) nvc0_compute_validate_constbufs(nvc0); if (nvc0->dirty_cp & NVC0_NEW_CP_DRIVERCONST) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.h b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.h index a23f7f3..19cc15a 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.h @@ -3,7 +3,7 @@ #include "nvc0/nvc0_compute.xml.h" -bool -nvc0_compute_validate_program(struct nvc0_context *nvc0); +void +nvc0_compute_validate_program(struct nvc0_context *); #endif /* NVC0_COMPUTE_H */ diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h index 0bbbff5..542d644 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h @@ -249,6 +249,7 @@ uint32_t nvc0_program_symbol_offset(const struct nvc0_program *, void nvc0_program_init_tcp_empty(struct nvc0_context *); /* nvc0_shader_state.c */ +bool nvc0_program_validate(struct nvc0_context *, struct nvc0_program *); void nvc0_vertprog_validate(struct nvc0_context *); void nvc0_tctlprog_validate(struct nvc0_context *); void nvc0_tevlprog_validate(struct nvc0_context *); diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c index 2f46c43..4def04f 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c @@ -64,7 +64,7 @@ nvc0_program_update_context_state(struct nvc0_context *nvc0, } } -static inline bool +bool nvc0_program_validate(struct nvc0_context *nvc0, struct nvc0_program *prog) { if (prog->mem) diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c index 0ffcfb1..60a7118 100644 --- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c @@ -321,8 +321,7 @@ nvc0_compute_validate_globals(struct nvc0_context *nvc0) static bool nve4_compute_state_validate(struct nvc0_context *nvc0) { - if (!nvc0_compute_validate_program(nvc0)) - return false; + nvc0_compute_validate_program(nvc0); if (nvc0->dirty_cp & NVC0_NEW_CP_TEXTURES) nve4_compute_validate_textures(nvc0); if (nvc0->dirty_cp & NVC0_NEW_CP_SAMPLERS) -- 2.6.4 ___ mesa-dev mailing list m
Re: [Mesa-dev] [PATCH 2/6] nvc0: rework nvc0_compute_validate_program()
Should you instead move nvc0_compute_validate into nvc0_shader_state? Currently that's where all this stuff lives. I see nvc0_program_validate as more of an "internal" module function that shouldn't be exported across files. On Sun, Feb 21, 2016 at 9:19 AM, Samuel Pitoiset wrote: > Reduce the amount of duplicated code by re-using > nvc0_program_validate(). While we are at it, change the prototype > to return void. > > Signed-off-by: Samuel Pitoiset > --- > src/gallium/drivers/nouveau/nvc0/nvc0_compute.c| 32 > ++ > src/gallium/drivers/nouveau/nvc0/nvc0_compute.h| 4 +-- > src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 1 + > .../drivers/nouveau/nvc0/nvc0_shader_state.c | 2 +- > src/gallium/drivers/nouveau/nvc0/nve4_compute.c| 3 +- > 5 files changed, 13 insertions(+), 29 deletions(-) > > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c > b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c > index 0f1265f..491221e 100644 > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c > @@ -120,32 +120,17 @@ nvc0_screen_compute_setup(struct nvc0_screen *screen, > return 0; > } > > -bool > +void > nvc0_compute_validate_program(struct nvc0_context *nvc0) > { > - struct nvc0_program *prog = nvc0->compprog; > - > - if (prog->mem) > - return true; > + struct nouveau_pushbuf *push = nvc0->base.pushbuf; > + struct nvc0_program *cp = nvc0->compprog; > > - if (!prog->translated) { > - prog->translated = nvc0_program_translate( > - prog, nvc0->screen->base.device->chipset, &nvc0->base.debug); > - if (!prog->translated) > - return false; > - } > - if (unlikely(!prog->code_size)) > - return false; > + if (cp && !nvc0_program_validate(nvc0, cp)) > + return; > > - if (likely(prog->code_size)) { > - if (nvc0_program_upload_code(nvc0, prog)) { > - struct nouveau_pushbuf *push = nvc0->base.pushbuf; > - BEGIN_NVC0(push, NVC0_CP(FLUSH), 1); > - PUSH_DATA (push, NVC0_COMPUTE_FLUSH_CODE); > - return true; > - } > - } > - return false; > + BEGIN_NVC0(push, NVC0_CP(FLUSH), 1); > + PUSH_DATA (push, NVC0_COMPUTE_FLUSH_CODE); > } > > static void > @@ -277,8 +262,7 @@ nvc0_compute_validate_buffers(struct nvc0_context *nvc0) > static bool > nvc0_compute_state_validate(struct nvc0_context *nvc0) > { > - if (!nvc0_compute_validate_program(nvc0)) > - return false; > + nvc0_compute_validate_program(nvc0); > if (nvc0->dirty_cp & NVC0_NEW_CP_CONSTBUF) >nvc0_compute_validate_constbufs(nvc0); > if (nvc0->dirty_cp & NVC0_NEW_CP_DRIVERCONST) > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.h > b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.h > index a23f7f3..19cc15a 100644 > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.h > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.h > @@ -3,7 +3,7 @@ > > #include "nvc0/nvc0_compute.xml.h" > > -bool > -nvc0_compute_validate_program(struct nvc0_context *nvc0); > +void > +nvc0_compute_validate_program(struct nvc0_context *); > > #endif /* NVC0_COMPUTE_H */ > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h > b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h > index 0bbbff5..542d644 100644 > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h > @@ -249,6 +249,7 @@ uint32_t nvc0_program_symbol_offset(const struct > nvc0_program *, > void nvc0_program_init_tcp_empty(struct nvc0_context *); > > /* nvc0_shader_state.c */ > +bool nvc0_program_validate(struct nvc0_context *, struct nvc0_program *); > void nvc0_vertprog_validate(struct nvc0_context *); > void nvc0_tctlprog_validate(struct nvc0_context *); > void nvc0_tevlprog_validate(struct nvc0_context *); > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c > b/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c > index 2f46c43..4def04f 100644 > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c > @@ -64,7 +64,7 @@ nvc0_program_update_context_state(struct nvc0_context *nvc0, > } > } > > -static inline bool > +bool > nvc0_program_validate(struct nvc0_context *nvc0, struct nvc0_program *prog) > { > if (prog->mem) > diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c > b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c > index 0ffcfb1..60a7118 100644 > --- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c > +++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c > @@ -321,8 +321,7 @@ nvc0_compute_validate_globals(struct nvc0_context *nvc0) > static bool > nve4_compute_state_validate(struct nvc0_context *nvc0) > { > - if (!nvc0_compute_validate_program(nvc0)) > - return false; > + nvc0_compute_validate_program(nvc0); > if (nvc0->dirty_cp & NVC0_NEW_CP_TEXTURES) >nve4_compute_validate_te
Re: [Mesa-dev] [PATCH 1/6] nvc0: move nvc0_validate_global_residents() to its correct location
On 02/22/2016 12:15 AM, Ilia Mirkin wrote: Nope. This will be needed on nvc0 as well if it's to support OpenCL. I was thinking the same thing actually but I was not sure. I think we should also validate those global buffers on Fermi. On Sun, Feb 21, 2016 at 9:19 AM, Samuel Pitoiset wrote: This function is currently only used for the compute validation path on GK104+. While we are at it, also rename it to nvc0_compute_validate_globals() and update its prototype. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 2 -- src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c | 15 --- src/gallium/drivers/nouveau/nvc0/nve4_compute.c| 18 -- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h index 64d7b74..0bbbff5 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h @@ -261,8 +261,6 @@ void nvc0_tfb_validate(struct nvc0_context *); extern void nvc0_init_state_functions(struct nvc0_context *); /* nvc0_state_validate.c */ -void nvc0_validate_global_residents(struct nvc0_context *, -struct nouveau_bufctx *, int bin); bool nvc0_state_validate(struct nvc0_context *, uint32_t state_mask); /* nvc0_surface.c */ diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c index 18e79e36..fbf45ce 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c @@ -559,21 +559,6 @@ nvc0_validate_driverconst(struct nvc0_context *nvc0) nvc0->dirty_cp |= NVC0_NEW_CP_DRIVERCONST; } -void -nvc0_validate_global_residents(struct nvc0_context *nvc0, - struct nouveau_bufctx *bctx, int bin) -{ - unsigned i; - - for (i = 0; i < nvc0->global_residents.size / sizeof(struct pipe_resource *); -++i) { - struct pipe_resource *res = *util_dynarray_element( - &nvc0->global_residents, struct pipe_resource *, i); - if (res) - nvc0_add_resident(bctx, bin, nv04_resource(res), NOUVEAU_BO_RDWR); - } -} - static void nvc0_validate_derived_1(struct nvc0_context *nvc0) { diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c index 652bc6d..0ffcfb1 100644 --- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c @@ -302,6 +302,21 @@ nve4_compute_set_tex_handles(struct nvc0_context *nvc0) nvc0->samplers_dirty[s] = 0; } +static void +nvc0_compute_validate_globals(struct nvc0_context *nvc0) +{ + unsigned i; + + for (i = 0; i < nvc0->global_residents.size / sizeof(struct pipe_resource *); +++i) { + struct pipe_resource *res = *util_dynarray_element( + &nvc0->global_residents, struct pipe_resource *, i); + if (res) + nvc0_add_resident(nvc0->bufctx_cp, NVC0_BIND_CP_GLOBAL, + nv04_resource(res), NOUVEAU_BO_RDWR); + } +} + static bool nve4_compute_state_validate(struct nvc0_context *nvc0) @@ -317,8 +332,7 @@ nve4_compute_state_validate(struct nvc0_context *nvc0) if (nvc0->dirty_cp & NVC0_NEW_CP_SURFACES) nve4_compute_validate_surfaces(nvc0); if (nvc0->dirty_cp & NVC0_NEW_CP_GLOBALS) - nvc0_validate_global_residents(nvc0, - nvc0->bufctx_cp, NVC0_BIND_CP_GLOBAL); + nvc0_compute_validate_globals(nvc0); nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, false); -- 2.6.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/6] nvc0: move nvc0_validate_global_residents() to its correct location
Nope. This will be needed on nvc0 as well if it's to support OpenCL. On Sun, Feb 21, 2016 at 9:19 AM, Samuel Pitoiset wrote: > This function is currently only used for the compute validation path > on GK104+. While we are at it, also rename it to > nvc0_compute_validate_globals() and update its prototype. > > Signed-off-by: Samuel Pitoiset > --- > src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 2 -- > src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c | 15 --- > src/gallium/drivers/nouveau/nvc0/nve4_compute.c| 18 > -- > 3 files changed, 16 insertions(+), 19 deletions(-) > > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h > b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h > index 64d7b74..0bbbff5 100644 > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h > @@ -261,8 +261,6 @@ void nvc0_tfb_validate(struct nvc0_context *); > extern void nvc0_init_state_functions(struct nvc0_context *); > > /* nvc0_state_validate.c */ > -void nvc0_validate_global_residents(struct nvc0_context *, > -struct nouveau_bufctx *, int bin); > bool nvc0_state_validate(struct nvc0_context *, uint32_t state_mask); > > /* nvc0_surface.c */ > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c > b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c > index 18e79e36..fbf45ce 100644 > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c > @@ -559,21 +559,6 @@ nvc0_validate_driverconst(struct nvc0_context *nvc0) > nvc0->dirty_cp |= NVC0_NEW_CP_DRIVERCONST; > } > > -void > -nvc0_validate_global_residents(struct nvc0_context *nvc0, > - struct nouveau_bufctx *bctx, int bin) > -{ > - unsigned i; > - > - for (i = 0; i < nvc0->global_residents.size / sizeof(struct pipe_resource > *); > -++i) { > - struct pipe_resource *res = *util_dynarray_element( > - &nvc0->global_residents, struct pipe_resource *, i); > - if (res) > - nvc0_add_resident(bctx, bin, nv04_resource(res), NOUVEAU_BO_RDWR); > - } > -} > - > static void > nvc0_validate_derived_1(struct nvc0_context *nvc0) > { > diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c > b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c > index 652bc6d..0ffcfb1 100644 > --- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c > +++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c > @@ -302,6 +302,21 @@ nve4_compute_set_tex_handles(struct nvc0_context *nvc0) > nvc0->samplers_dirty[s] = 0; > } > > +static void > +nvc0_compute_validate_globals(struct nvc0_context *nvc0) > +{ > + unsigned i; > + > + for (i = 0; i < nvc0->global_residents.size / sizeof(struct pipe_resource > *); > +++i) { > + struct pipe_resource *res = *util_dynarray_element( > + &nvc0->global_residents, struct pipe_resource *, i); > + if (res) > + nvc0_add_resident(nvc0->bufctx_cp, NVC0_BIND_CP_GLOBAL, > + nv04_resource(res), NOUVEAU_BO_RDWR); > + } > +} > + > > static bool > nve4_compute_state_validate(struct nvc0_context *nvc0) > @@ -317,8 +332,7 @@ nve4_compute_state_validate(struct nvc0_context *nvc0) > if (nvc0->dirty_cp & NVC0_NEW_CP_SURFACES) >nve4_compute_validate_surfaces(nvc0); > if (nvc0->dirty_cp & NVC0_NEW_CP_GLOBALS) > - nvc0_validate_global_residents(nvc0, > - nvc0->bufctx_cp, NVC0_BIND_CP_GLOBAL); > + nvc0_compute_validate_globals(nvc0); > > nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, false); > > -- > 2.6.4 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 5/5] nvc0: rename 3d binding points to NVC0_BIND_3D_XXX
On 02/22/2016 12:08 AM, Ilia Mirkin wrote: On Sun, Feb 21, 2016 at 9:18 AM, Samuel Pitoiset wrote: /* 3d bufctx (during draw_vbo, blit_3d) */ -#define NVC0_BIND_FB0 -#define NVC0_BIND_VTX 1 -#define NVC0_BIND_VTX_TMP 2 -#define NVC0_BIND_IDX 3 -#define NVC0_BIND_TEX(s, i) ( 4 + 32 * (s) + (i)) -#define NVC0_BIND_CB(s, i) (164 + 16 * (s) + (i)) -#define NVC0_BIND_TFB 244 -#define NVC0_BIND_SUF 245 -#define NVC0_BIND_BUF 246 -#define NVC0_BIND_SCREEN 247 -#define NVC0_BIND_TLS 249 -#define NVC0_BIND_3D_COUNT250 +#define NVC0_BIND_3D_FB0 +#define NVC0_BIND_3D_VTX 1 +#define NVC0_BIND_3D_VTX_TMP 2 +#define NVC0_BIND_3D_IDX 3 +#define NVC0_BIND_3D_TEX(s, i) ( 4 + 32 * (s) + (i)) +#define NVC0_BIND_3D_CB(s, i) (164 + 16 * (s) + (i)) +#define NVC0_BIND_3D_TFB 244 +#define NVC0_BIND_3D_SUF 245 +#define NVC0_BIND_3D_BUF 246 +#define NVC0_BIND_3D_SCREEN 247 +#define NVC0_BIND_3D_TLS 249 +#define NVC0_BIND_3D_3D_COUNT250 I think you want to leave 3D_COUNT alone... the point was to distinguish it from the CP_COUNT I think, but 3D_3D_COUNT seems a bit excessive :) Otherwise, this series is Good catch, I need to remove one of the 3D. :-) Reviewed-by: Ilia Mirkin ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 5/5] nvc0: rename 3d binding points to NVC0_BIND_3D_XXX
On Sun, Feb 21, 2016 at 9:18 AM, Samuel Pitoiset wrote: > > /* 3d bufctx (during draw_vbo, blit_3d) */ > -#define NVC0_BIND_FB0 > -#define NVC0_BIND_VTX 1 > -#define NVC0_BIND_VTX_TMP 2 > -#define NVC0_BIND_IDX 3 > -#define NVC0_BIND_TEX(s, i) ( 4 + 32 * (s) + (i)) > -#define NVC0_BIND_CB(s, i) (164 + 16 * (s) + (i)) > -#define NVC0_BIND_TFB 244 > -#define NVC0_BIND_SUF 245 > -#define NVC0_BIND_BUF 246 > -#define NVC0_BIND_SCREEN 247 > -#define NVC0_BIND_TLS 249 > -#define NVC0_BIND_3D_COUNT250 > +#define NVC0_BIND_3D_FB0 > +#define NVC0_BIND_3D_VTX 1 > +#define NVC0_BIND_3D_VTX_TMP 2 > +#define NVC0_BIND_3D_IDX 3 > +#define NVC0_BIND_3D_TEX(s, i) ( 4 + 32 * (s) + (i)) > +#define NVC0_BIND_3D_CB(s, i) (164 + 16 * (s) + (i)) > +#define NVC0_BIND_3D_TFB 244 > +#define NVC0_BIND_3D_SUF 245 > +#define NVC0_BIND_3D_BUF 246 > +#define NVC0_BIND_3D_SCREEN 247 > +#define NVC0_BIND_3D_TLS 249 > +#define NVC0_BIND_3D_3D_COUNT250 I think you want to leave 3D_COUNT alone... the point was to distinguish it from the CP_COUNT I think, but 3D_3D_COUNT seems a bit excessive :) Otherwise, this series is Reviewed-by: Ilia Mirkin ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] vulkan: Move XML and generator into src/intel/genxml
On Sun, 2016-02-21 at 12:01 +, Steven Newbury wrote: > On Sun, 2016-02-21 at 11:28 +, Steven Newbury wrote: > > On Sun, 2016-02-21 at 10:56 +, Steven Newbury wrote: > > > On Sun, 2016-02-21 at 10:16 +, Steven Newbury wrote: > > > > Hi Jason, > > > > > > > > commit f6d95876888c81559d4ba773e4e6c82b184e708e in the vulkan > > > > branch > > > > has broken out-of-source-tree builds. The generated header > > > > files > > > > should be included from the build tree, instead of the source > > > > tree. > > > > > > --- src/intel/vulkan/Makefile.am~ 2016-02-21 > > > 09:27:01.0 + > > > +++ src/intel/vulkan/Makefile.am 2016-02-21 > > > 10:36:01.625996990 > > > + > > > @@ -30,6 +30,7 @@ > > > > > > # Used when generating entrypoints to filter out unwanted > > > extensions > > > VULKAN_ENTRYPOINT_CPPFLAGS = \ > > > + -I$(top_builddir)/include/vulkan \ > > > -I$(top_srcdir)/include/vulkan \ > > > -DVK_USE_PLATFORM_XCB_KHR \ > > > -DVK_USE_PLATFORM_WAYLAND_KHR > > > > Apologies, I obviously needed my coffee. > > > > Let me try again: > > > > --- src/intel/vulkan/Makefile.am~ 2016-02-21 > > 11:22:59.0 > > + > > +++ src/intel/vulkan/Makefile.am2016-02-21 > > 11:26:13.149236044 > > + > > @@ -66,6 +66,7 @@ > > -I$(top_builddir)/src/compiler \ > > -I$(top_builddir)/src/compiler/nir \ > > -I$(top_builddir)/src/intel \ > > + -I$(top_builddir)/src/intel/vulkan/genxml \ > > -I$(top_builddir)/src/vulkan > > > > libvulkan_intel_la_CFLAGS = $(CFLAGS) -Wno-override-init > > I'll leave it to you, that didn't work either. :-( embarrasing. It should have been src/intel/genxml. I waited for the build to finish sucessfully this time! :-) --- src/intel/vulkan/Makefile.am~ 2016-02-21 11:22:59.0 + +++ src/intel/vulkan/Makefile.am2016-02-21 11:26:13.149236044 + @@ -66,6 +66,7 @@ -I$(top_builddir)/src/compiler \ -I$(top_builddir)/src/compiler/nir \ -I$(top_builddir)/src/intel \ + -I$(top_builddir)/src/intel/genxml \ -I$(top_builddir)/src/vulkan libvulkan_intel_la_CFLAGS = $(CFLAGS) -Wno-override-init ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] vulkan: Move XML and generator into src/intel/genxml
On Sun, 2016-02-21 at 10:56 +, Steven Newbury wrote: > On Sun, 2016-02-21 at 10:16 +, Steven Newbury wrote: > > Hi Jason, > > > > commit f6d95876888c81559d4ba773e4e6c82b184e708e in the vulkan > > branch > > has broken out-of-source-tree builds. The generated header files > > should be included from the build tree, instead of the source tree. > > --- src/intel/vulkan/Makefile.am~ 2016-02-21 > 09:27:01.0 + > +++ src/intel/vulkan/Makefile.am 2016-02-21 10:36:01.625996990 > + > @@ -30,6 +30,7 @@ > > # Used when generating entrypoints to filter out unwanted extensions > VULKAN_ENTRYPOINT_CPPFLAGS = \ > + -I$(top_builddir)/include/vulkan \ > -I$(top_srcdir)/include/vulkan \ > -DVK_USE_PLATFORM_XCB_KHR \ > -DVK_USE_PLATFORM_WAYLAND_KHR Apologies, I obviously needed my coffee. Let me try again: --- src/intel/vulkan/Makefile.am~ 2016-02-21 11:22:59.0 + +++ src/intel/vulkan/Makefile.am2016-02-21 11:26:13.149236044 + @@ -66,6 +66,7 @@ -I$(top_builddir)/src/compiler \ -I$(top_builddir)/src/compiler/nir \ -I$(top_builddir)/src/intel \ + -I$(top_builddir)/src/intel/vulkan/genxml \ -I$(top_builddir)/src/vulkan libvulkan_intel_la_CFLAGS = $(CFLAGS) -Wno-override-init ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] vulkan: Move XML and generator into src/intel/genxml
On Sun, 2016-02-21 at 10:16 +, Steven Newbury wrote: > Hi Jason, > > commit f6d95876888c81559d4ba773e4e6c82b184e708e in the vulkan branch > has broken out-of-source-tree builds. The generated header files > should be included from the build tree, instead of the source tree. --- src/intel/vulkan/Makefile.am~ 2016-02-21 09:27:01.0 + +++ src/intel/vulkan/Makefile.am2016-02-21 10:36:01.625996990 + @@ -30,6 +30,7 @@ # Used when generating entrypoints to filter out unwanted extensions VULKAN_ENTRYPOINT_CPPFLAGS = \ + -I$(top_builddir)/include/vulkan \ -I$(top_srcdir)/include/vulkan \ -DVK_USE_PLATFORM_XCB_KHR \ -DVK_USE_PLATFORM_WAYLAND_KHR ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] Is that possible implement OpenGL/DirectX on top of Vulkan
-- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] vulkan: Move XML and generator into src/intel/genxml
Hi Jason, commit f6d95876888c81559d4ba773e4e6c82b184e708e in the vulkan branch has broken out-of-source-tree builds. The generated header files should be included from the build tree, instead of the source tree. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] vulkan: Move XML and generator into src/intel/genxml
On Sun, 2016-02-21 at 11:28 +, Steven Newbury wrote: > On Sun, 2016-02-21 at 10:56 +, Steven Newbury wrote: > > On Sun, 2016-02-21 at 10:16 +, Steven Newbury wrote: > > > Hi Jason, > > > > > > commit f6d95876888c81559d4ba773e4e6c82b184e708e in the vulkan > > > branch > > > has broken out-of-source-tree builds. The generated header files > > > should be included from the build tree, instead of the source > > > tree. > > > > --- src/intel/vulkan/Makefile.am~ 2016-02-21 > > 09:27:01.0 + > > +++ src/intel/vulkan/Makefile.am2016-02-21 > > 10:36:01.625996990 > > + > > @@ -30,6 +30,7 @@ > > > > # Used when generating entrypoints to filter out unwanted > > extensions > > VULKAN_ENTRYPOINT_CPPFLAGS = \ > > + -I$(top_builddir)/include/vulkan \ > > -I$(top_srcdir)/include/vulkan \ > > -DVK_USE_PLATFORM_XCB_KHR \ > > -DVK_USE_PLATFORM_WAYLAND_KHR > > Apologies, I obviously needed my coffee. > > Let me try again: > > --- src/intel/vulkan/Makefile.am~ 2016-02-21 > 11:22:59.0 > + > +++ src/intel/vulkan/Makefile.am 2016-02-21 11:26:13.149236044 > + > @@ -66,6 +66,7 @@ > -I$(top_builddir)/src/compiler \ > -I$(top_builddir)/src/compiler/nir \ > -I$(top_builddir)/src/intel \ > + -I$(top_builddir)/src/intel/vulkan/genxml \ > -I$(top_builddir)/src/vulkan > > libvulkan_intel_la_CFLAGS = $(CFLAGS) -Wno-override-init I'll leave it to you, that didn't work either. :-( embarrasing. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] nv50/ir: restore OP_SELP to be a regular instruction
Reviewed-by: Ilia Mirkin Thanks for taking care of it! On Sun, Feb 21, 2016 at 1:40 PM, Samuel Pitoiset wrote: > Actually OP_SELP doesn't need to be a compare instruction. Instead we > just need to set the NOT modifier when building the instruction. > While we are at it, fix the dst register type and use a GPR. > > Suggested by Ilia Mirkin. > > Signed-off-by: Samuel Pitoiset > --- > src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp| 8 > src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 8 > src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h | 4 ++-- > src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 8 > 4 files changed, 14 insertions(+), 14 deletions(-) > > diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp > b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp > index 8268e08..a78b3f9 100644 > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp > @@ -112,7 +112,7 @@ private: > > void emitSET(const CmpInstruction *); > void emitSLCT(const CmpInstruction *); > - void emitSELP(const CmpInstruction *); > + void emitSELP(const Instruction *); > > void emitTEXBAR(const Instruction *); > void emitTEX(const TexInstruction *); > @@ -1045,11 +1045,11 @@ CodeEmitterGK110::emitSLCT(const CmpInstruction *i) > } > } > > -void CodeEmitterGK110::emitSELP(const CmpInstruction *i) > +void CodeEmitterGK110::emitSELP(const Instruction *i) > { > emitForm_21(i, 0x250, 0x050); > > - if ((i->setCond == CC_NOT_P) ^ (bool)(i->src(2).mod & > Modifier(NV50_IR_MOD_NOT))) > + if (i->src(2).mod & Modifier(NV50_IR_MOD_NOT)) >code[1] |= 1 << 13; > } > > @@ -1937,7 +1937,7 @@ CodeEmitterGK110::emitInstruction(Instruction *insn) >emitSET(insn->asCmp()); >break; > case OP_SELP: > - emitSELP(insn->asCmp()); > + emitSELP(insn); >break; > case OP_SLCT: >emitSLCT(insn->asCmp()); > diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp > b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp > index d588d7e..65fcd64 100644 > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp > @@ -120,7 +120,7 @@ private: > > void emitSET(const CmpInstruction *); > void emitSLCT(const CmpInstruction *); > - void emitSELP(const CmpInstruction *); > + void emitSELP(const Instruction *); > > void emitTEXBAR(const Instruction *); > void emitTEX(const TexInstruction *); > @@ -1175,11 +1175,11 @@ CodeEmitterNVC0::emitSLCT(const CmpInstruction *i) >code[0] |= 1 << 5; > } > > -void CodeEmitterNVC0::emitSELP(const CmpInstruction *i) > +void CodeEmitterNVC0::emitSELP(const Instruction *i) > { > emitForm_A(i, HEX64(2000, 0004)); > > - if (i->setCond == CC_NOT_P || i->src(2).mod & Modifier(NV50_IR_MOD_NOT)) > + if (i->src(2).mod & Modifier(NV50_IR_MOD_NOT)) >code[1] |= 1 << 20; > } > > @@ -2438,7 +2438,7 @@ CodeEmitterNVC0::emitInstruction(Instruction *insn) >emitSET(insn->asCmp()); >break; > case OP_SELP: > - emitSELP(insn->asCmp()); > + emitSELP(insn); >break; > case OP_SLCT: >emitSLCT(insn->asCmp()); > diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h > b/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h > index 02e6157..e465f24 100644 > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h > @@ -281,14 +281,14 @@ Value *TexInstruction::getIndirectS() const > > CmpInstruction *Instruction::asCmp() > { > - if (op >= OP_SET_AND && op <= OP_SLCT) > + if (op >= OP_SET_AND && op <= OP_SLCT && op != OP_SELP) >return static_cast(this); > return NULL; > } > > const CmpInstruction *Instruction::asCmp() const > { > - if (op >= OP_SET_AND && op <= OP_SLCT) > + if (op >= OP_SET_AND && op <= OP_SLCT && op != OP_SELP) >return static_cast(this); > return NULL; > } > diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp > b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp > index 21a6f1e..d181f15 100644 > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp > @@ -1067,10 +1067,10 @@ NVC0LoweringPass::handleSharedATOM(Instruction *atom) > TYPE_U32, ld->getDef(0), atom->getSrc(1)); >set->setPredicate(CC_P, ld->getDef(1)); > > - CmpInstruction *selp = > - bld.mkCmp(OP_SELP, CC_NOT_P, TYPE_U32, bld.getSSA(4, FILE_ADDRESS), > - TYPE_U32, ld->getDef(0), atom->getSrc(2), > - set->getDef(0)); > + Instruction *selp = > + bld.mkOp3(OP_SELP, TYPE_U32, bld.getSSA(), ld->getDef(
Re: [Mesa-dev] [PATCH 3/3] st/mesa: shader image atoms must be before framebuffer update
For the series: Reviewed-by: Marek Olšák Marek On Sat, Feb 20, 2016 at 10:39 PM, Nicolai Hähnle wrote: > From: Nicolai Hähnle > > The reason is that the shader image atoms call st_finalize_texture, which > may set ST_NEW_FRAMEBUFFER. > > This fixes an assertion triggered by a subtest of piglit's > arb_shader_image_load_store-invalid. > --- > src/mesa/state_tracker/st_atom.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/src/mesa/state_tracker/st_atom.c > b/src/mesa/state_tracker/st_atom.c > index 622621b..73b10ba 100644 > --- a/src/mesa/state_tracker/st_atom.c > +++ b/src/mesa/state_tracker/st_atom.c > @@ -62,6 +62,11 @@ static const struct st_tracked_state *render_atoms[] = > &st_update_tessctrl_texture, > &st_update_tesseval_texture, > &st_update_sampler, /* depends on update_*_texture for swizzle */ > + &st_bind_vs_images, > + &st_bind_tcs_images, > + &st_bind_tes_images, > + &st_bind_gs_images, > + &st_bind_fs_images, > &st_update_framebuffer, > &st_update_msaa, > &st_update_sample_shading, > @@ -85,11 +90,6 @@ static const struct st_tracked_state *render_atoms[] = > &st_bind_tes_ssbos, > &st_bind_fs_ssbos, > &st_bind_gs_ssbos, > - &st_bind_vs_images, > - &st_bind_tcs_images, > - &st_bind_tes_images, > - &st_bind_gs_images, > - &st_bind_fs_images, > &st_update_pixel_transfer, > &st_update_tess, > > -- > 2.5.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v3 02/14] nvc0: bind constant buffers for compute on Fermi
On 02/21/2016 06:49 PM, Ilia Mirkin wrote: On Wed, Feb 17, 2016 at 4:27 PM, Samuel Pitoiset wrote: Loosely based on 3D. Changs from v3: - invalidate COMPUTE CBs after validating 3D CBs because they are aliased Changes from v2: - get rid of the 's' param to nvc0_cb_bo_push() because it doesn't matter to upload constbufs for compute using the 3d chan Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c| 72 +++--- src/gallium/drivers/nouveau/nvc0/nvc0_context.c| 11 +++- src/gallium/drivers/nouveau/nvc0/nvc0_screen.h | 2 +- src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 4 +- .../drivers/nouveau/nvc0/nvc0_state_validate.c | 5 ++ 5 files changed, 81 insertions(+), 13 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index 5c7dc0e..0fe6353 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -138,11 +138,71 @@ nvc0_compute_validate_program(struct nvc0_context *nvc0) return false; } +static void +nvc0_compute_validate_constbufs(struct nvc0_context *nvc0) +{ + struct nouveau_pushbuf *push = nvc0->base.pushbuf; + const int s = 5; + + while (nvc0->constbuf_dirty[s]) { + int i = ffs(nvc0->constbuf_dirty[s]) - 1; + nvc0->constbuf_dirty[s] &= ~(1 << i); + + if (nvc0->constbuf[s][i].user) { + struct nouveau_bo *bo = nvc0->screen->uniform_bo; + const unsigned base = s << 16; + const unsigned size = nvc0->constbuf[s][0].size; + assert(i == 0); /* we really only want OpenGL uniforms here */ + assert(nvc0->constbuf[s][0].u.data); + + if (nvc0->state.uniform_buffer_bound[s] < size) { +nvc0->state.uniform_buffer_bound[s] = align(size, 0x100); + +BEGIN_NVC0(push, NVC0_COMPUTE(CB_SIZE), 3); +PUSH_DATA (push, nvc0->state.uniform_buffer_bound[s]); +PUSH_DATAh(push, bo->offset + base); +PUSH_DATA (push, bo->offset + base); +BEGIN_NVC0(push, NVC0_COMPUTE(CB_BIND), 1); +PUSH_DATA (push, (0 << 8) | 1); + } + nvc0_cb_bo_push(&nvc0->base, bo, NV_VRAM_DOMAIN(&nvc0->screen->base), + base, nvc0->state.uniform_buffer_bound[s], + 0, (size + 3) / 4, + nvc0->constbuf[s][0].u.data); + } else { + struct nv04_resource *res = +nv04_resource(nvc0->constbuf[s][i].u.buf); + if (res) { +BEGIN_NVC0(push, NVC0_COMPUTE(CB_SIZE), 3); +PUSH_DATA (push, nvc0->constbuf[s][i].size); +PUSH_DATAh(push, res->address + nvc0->constbuf[s][i].offset); +PUSH_DATA (push, res->address + nvc0->constbuf[s][i].offset); +BEGIN_NVC0(push, NVC0_COMPUTE(CB_BIND), 1); +PUSH_DATA (push, (i << 8) | 1); + +BCTX_REFN(nvc0->bufctx_cp, CP_CB(i), res, RD); + +res->cb_bindings[s] |= 1 << i; + } else { +BEGIN_NVC0(push, NVC0_COMPUTE(CB_BIND), 1); +PUSH_DATA (push, (i << 8) | 0); + } + if (i == 0) +nvc0->state.uniform_buffer_bound[s] = 0; + } + } + + BEGIN_NVC0(push, NVC0_COMPUTE(FLUSH), 1); + PUSH_DATA (push, NVC0_COMPUTE_FLUSH_CB); +} + static bool nvc0_compute_state_validate(struct nvc0_context *nvc0) { if (!nvc0_compute_validate_program(nvc0)) return false; + if (nvc0->dirty_cp & NVC0_NEW_CP_CONSTBUF) + nvc0_compute_validate_constbufs(nvc0); /* TODO: textures, samplers, surfaces, global memory buffers */ @@ -188,7 +248,7 @@ nvc0_launch_grid(struct pipe_context *pipe, const struct pipe_grid_info *info) struct nvc0_context *nvc0 = nvc0_context(pipe); struct nouveau_pushbuf *push = nvc0->base.pushbuf; struct nvc0_program *cp = nvc0->compprog; - unsigned s, i; + unsigned s; int ret; ret = !nvc0_compute_state_validate(nvc0); @@ -242,14 +302,10 @@ nvc0_launch_grid(struct pipe_context *pipe, const struct pipe_grid_info *info) BEGIN_NVC0(push, SUBC_COMPUTE(0x0360), 1); PUSH_DATA (push, 0x1); - /* rebind all the 3D constant buffers -* (looks like binding a CB on COMPUTE clobbers 3D state) */ + /* Invalidate all 3D constbufs because they are aliased with COMPUTE. */ nvc0->dirty |= NVC0_NEW_CONSTBUF; for (s = 0; s < 5; s++) { - for (i = 0; i < NVC0_MAX_PIPE_CONSTBUFS; i++) - if (nvc0->constbuf[s][i].u.buf) -nvc0->constbuf_dirty[s] |= 1 << i; + nvc0->constbuf_dirty[s] |= nvc0->constbuf_valid[s]; + nvc0->state.uniform_buffer_bound[s] = 0; } - memset(nvc0->state.uniform_buffer_bound, 0, - sizeof(nvc0->state.uniform_buffer_bound)); } diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c index 547b8f5..4fed7b2 10064
[Mesa-dev] [PATCH 1/6] nvc0: move nvc0_validate_global_residents() to its correct location
This function is currently only used for the compute validation path on GK104+. While we are at it, also rename it to nvc0_compute_validate_globals() and update its prototype. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 2 -- src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c | 15 --- src/gallium/drivers/nouveau/nvc0/nve4_compute.c| 18 -- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h index 64d7b74..0bbbff5 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h @@ -261,8 +261,6 @@ void nvc0_tfb_validate(struct nvc0_context *); extern void nvc0_init_state_functions(struct nvc0_context *); /* nvc0_state_validate.c */ -void nvc0_validate_global_residents(struct nvc0_context *, -struct nouveau_bufctx *, int bin); bool nvc0_state_validate(struct nvc0_context *, uint32_t state_mask); /* nvc0_surface.c */ diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c index 18e79e36..fbf45ce 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c @@ -559,21 +559,6 @@ nvc0_validate_driverconst(struct nvc0_context *nvc0) nvc0->dirty_cp |= NVC0_NEW_CP_DRIVERCONST; } -void -nvc0_validate_global_residents(struct nvc0_context *nvc0, - struct nouveau_bufctx *bctx, int bin) -{ - unsigned i; - - for (i = 0; i < nvc0->global_residents.size / sizeof(struct pipe_resource *); -++i) { - struct pipe_resource *res = *util_dynarray_element( - &nvc0->global_residents, struct pipe_resource *, i); - if (res) - nvc0_add_resident(bctx, bin, nv04_resource(res), NOUVEAU_BO_RDWR); - } -} - static void nvc0_validate_derived_1(struct nvc0_context *nvc0) { diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c index 652bc6d..0ffcfb1 100644 --- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c @@ -302,6 +302,21 @@ nve4_compute_set_tex_handles(struct nvc0_context *nvc0) nvc0->samplers_dirty[s] = 0; } +static void +nvc0_compute_validate_globals(struct nvc0_context *nvc0) +{ + unsigned i; + + for (i = 0; i < nvc0->global_residents.size / sizeof(struct pipe_resource *); +++i) { + struct pipe_resource *res = *util_dynarray_element( + &nvc0->global_residents, struct pipe_resource *, i); + if (res) + nvc0_add_resident(nvc0->bufctx_cp, NVC0_BIND_CP_GLOBAL, + nv04_resource(res), NOUVEAU_BO_RDWR); + } +} + static bool nve4_compute_state_validate(struct nvc0_context *nvc0) @@ -317,8 +332,7 @@ nve4_compute_state_validate(struct nvc0_context *nvc0) if (nvc0->dirty_cp & NVC0_NEW_CP_SURFACES) nve4_compute_validate_surfaces(nvc0); if (nvc0->dirty_cp & NVC0_NEW_CP_GLOBALS) - nvc0_validate_global_residents(nvc0, - nvc0->bufctx_cp, NVC0_BIND_CP_GLOBAL); + nvc0_compute_validate_globals(nvc0); nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, false); -- 2.6.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] st/nine: Introduce helper for Position shader input
Signed-off-by: Axel Davy --- src/gallium/state_trackers/nine/nine_shader.c | 31 +-- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index a7a7da2..f0c5236 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -830,6 +830,18 @@ nine_ureg_dst_register(unsigned file, int index) return ureg_dst(ureg_src_register(file, index)); } +static inline struct ureg_src +nine_get_position_input(struct shader_translator *tx) +{ +struct ureg_program *ureg = tx->ureg; + +if (tx->wpos_is_sysval) +return ureg_DECL_system_value(ureg, TGSI_SEMANTIC_POSITION, 0); +else +return ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_POSITION, + 0, TGSI_INTERPOLATE_LINEAR); +} + static struct ureg_src tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param) { @@ -955,16 +967,8 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param) case D3DSPR_MISCTYPE: switch (param->idx) { case D3DSMO_POSITION: - if (ureg_src_is_undef(tx->regs.vPos)) { - if (tx->wpos_is_sysval) { - tx->regs.vPos = - ureg_DECL_system_value(ureg, TGSI_SEMANTIC_POSITION, 0); - } else { - tx->regs.vPos = - ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_POSITION, 0, - TGSI_INTERPOLATE_LINEAR); - } - } + if (ureg_src_is_undef(tx->regs.vPos)) + tx->regs.vPos = nine_get_position_input(tx); if (tx->shift_wpos) { /* TODO: do this only once */ struct ureg_dst wpos = tx_scratch(tx); @@ -3269,12 +3273,7 @@ shader_add_ps_fog_stage(struct shader_translator *tx, struct ureg_src src_col) } if (tx->info->fog_mode != D3DFOG_NONE) { -if (tx->wpos_is_sysval) { -depth = ureg_DECL_system_value(ureg, TGSI_SEMANTIC_POSITION, 0); -} else { -depth = ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_POSITION, 0, - TGSI_INTERPOLATE_LINEAR); -} +depth = nine_get_position_input(tx); depth = ureg_scalar(depth, TGSI_SWIZZLE_Z); } -- 2.7.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] abundance of branches in mesa.git
On Sat, 2016-02-20 at 13:41 -0800, Jason Ekstrand wrote: > On Feb 20, 2016 1:19 PM, "Rob Clark" wrote: > > > > fwiw, I think a *small* number of topic branches in certain cases > > makes sense.. I'm definitely in support of a TTL limit (ie. > > automatically nuke topic branches with no activity in N months, or > > similar..) > > I agree. Sometimes something big comes up that's not ready for > merging such > as amdgpu or our recently pushed Vulkan driver. However, those > should only > be temporary and removed once the work is complete. I saw a > "broadwell" > branch in there which is probably at least 2 years old and completely > subsumed by master. We don't want to be archiving random junk in the > main > tree. > > I'd be fine with a timeout system where non-release branches get the > boot > after a certain amount inactivity. If you want to archive something, > that's > what personal git repos are for. > --Jason > I think it makes sense to have a publicly accessible archive repo for nuked feature branches otherwise potentially useful code could just be lost. signature.asc Description: This is a digitally signed message part ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 94232] Problems compiling mesa with glibc 2.23
https://bugs.freedesktop.org/show_bug.cgi?id=94232 Bug ID: 94232 Summary: Problems compiling mesa with glibc 2.23 Product: Mesa Version: git Hardware: Other OS: All Status: NEW Severity: normal Priority: medium Component: Mesa core Assignee: mesa-dev@lists.freedesktop.org Reporter: m...@fireburn.co.uk QA Contact: mesa-dev@lists.freedesktop.org Created attachment 121866 --> https://bugs.freedesktop.org/attachment.cgi?id=121866&action=edit Patch to include sys/sysmacros.h in mesa I get errors about major and minor not being defined when compiling mesa after upgrading glibc to 2.23 Including sys/sysmacros.h fixes it for me -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 4/6] nvc0: introduce a flushed flag for compute validation path
Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 4 +++- src/gallium/drivers/nouveau/nvc0/nvc0_context.c | 4 +++- src/gallium/drivers/nouveau/nvc0/nvc0_screen.h | 1 + src/gallium/drivers/nouveau/nvc0/nve4_compute.c | 4 +++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index 0717583..f76a10c 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -281,8 +281,10 @@ nvc0_compute_state_validate(struct nvc0_context *nvc0) nouveau_pushbuf_bufctx(nvc0->base.pushbuf, nvc0->bufctx_cp); if (unlikely(nouveau_pushbuf_validate(nvc0->base.pushbuf))) return false; - if (unlikely(nvc0->state.flushed_3d)) + if (unlikely(nvc0->state.flushed_cp)) { + nvc0->state.flushed_cp = false; nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, true); + } return true; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c index 683fc20..cfd4cab 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c @@ -176,8 +176,10 @@ nvc0_default_kick_notify(struct nouveau_pushbuf *push) if (screen) { nouveau_fence_next(&screen->base); nouveau_fence_update(&screen->base, true); - if (screen->cur_ctx) + if (screen->cur_ctx) { screen->cur_ctx->state.flushed_3d = true; + screen->cur_ctx->state.flushed_cp = true; + } NOUVEAU_DRV_STAT(&screen->base, pushbuf_count, 1); } } diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h index 9a58da5..f47beee 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h @@ -31,6 +31,7 @@ struct nvc0_blitter; struct nvc0_graph_state { bool flushed_3d; + bool flushed_cp; bool rasterizer_discard; bool early_z_forced; bool prim_restart; diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c index e33458b..fae8c60 100644 --- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c @@ -338,8 +338,10 @@ nve4_compute_state_validate(struct nvc0_context *nvc0) nouveau_pushbuf_bufctx(nvc0->base.pushbuf, nvc0->bufctx_cp); if (unlikely(nouveau_pushbuf_validate(nvc0->base.pushbuf))) return false; - if (unlikely(nvc0->state.flushed_3d)) + if (unlikely(nvc0->state.flushed_cp)) { + nvc0->state.flushed_cp = false; nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, true); + } return true; } -- 2.6.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 0/6] nvc0: new validation path for compute
Hi, This series reworks the validation path for compute. There are no regressions for both piglit and deqp on my NVD9. I also tested MP performance counters which use a compute program to read the counters, works fine too. Please review. Samuel Pitoiset (6): nvc0: move nvc0_validate_global_residents() to its correct location nvc0: rework nvc0_compute_validate_program() nvc0: rename nvc0_graph_state::flushed to ::flushed_3d nvc0: introduce a flushed flag for compute validation path nvc0: rework the validation path for 3D nvc0: add new validation path for compute src/gallium/drivers/nouveau/Makefile.sources | 1 + src/gallium/drivers/nouveau/nvc0/nvc0_compute.c| 72 +++--- src/gallium/drivers/nouveau/nvc0/nvc0_compute.h| 4 +- src/gallium/drivers/nouveau/nvc0/nvc0_context.c| 6 +- src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 6 +- src/gallium/drivers/nouveau/nvc0/nvc0_screen.h | 3 +- .../drivers/nouveau/nvc0/nvc0_shader_state.c | 2 +- .../drivers/nouveau/nvc0/nvc0_state_validate.c | 53 .../drivers/nouveau/nvc0/nvc0_state_validate.h | 19 ++ src/gallium/drivers/nouveau/nvc0/nvc0_surface.c| 5 +- src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c| 3 +- src/gallium/drivers/nouveau/nvc0/nve4_compute.c| 56 + 12 files changed, 112 insertions(+), 118 deletions(-) create mode 100644 src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.h -- 2.6.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/5] nvc0: prefix compute macros with _CP_ instead of _COMPUTE_
Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme | 2 +- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 2 +- src/gallium/drivers/nouveau/nvc0/nvc0_macros.h | 2 +- src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme b/src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme index a3f1bde..a9233ad 100644 --- a/src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme +++ b/src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme @@ -1,4 +1,4 @@ -/* NVC0_COMPUTE_MACRO_LAUNCH_GRID_INDIRECT +/* NVC0_CP_MACRO_LAUNCH_GRID_INDIRECT * * arg = num_groups_x * parm[0] = num_groups_y diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index 3f7a7d3..112f1c4 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -376,7 +376,7 @@ nvc0_launch_grid(struct pipe_context *pipe, const struct pipe_grid_info *info) if (unlikely(info->indirect)) { struct nv04_resource *res = nv04_resource(info->indirect); uint32_t offset = res->offset + info->indirect_offset; - unsigned macro = NVC0_COMPUTE_MACRO_LAUNCH_GRID_INDIRECT; + unsigned macro = NVC0_CP_MACRO_LAUNCH_GRID_INDIRECT; nouveau_pushbuf_space(push, 16, 0, 1); PUSH_REFN(push, res->bo, NOUVEAU_BO_RD | res->domain); diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_macros.h b/src/gallium/drivers/nouveau/nvc0/nvc0_macros.h index 57262fe..eeacc71 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_macros.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_macros.h @@ -35,6 +35,6 @@ #define NVC0_3D_MACRO_QUERY_BUFFER_WRITE 0x3858 -#define NVC0_COMPUTE_MACRO_LAUNCH_GRID_INDIRECT 0x3860 +#define NVC0_CP_MACRO_LAUNCH_GRID_INDIRECT 0x3860 #endif /* __NVC0_MACROS_H__ */ diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c index 1730a1b..998e9ea 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c @@ -1077,7 +1077,7 @@ nvc0_screen_create(struct nouveau_device *dev) MK_MACRO(NVC0_3D_MACRO_DRAW_ARRAYS_INDIRECT_COUNT, mme9097_draw_arrays_indirect_count); MK_MACRO(NVC0_3D_MACRO_DRAW_ELEMENTS_INDIRECT_COUNT, mme9097_draw_elts_indirect_count); MK_MACRO(NVC0_3D_MACRO_QUERY_BUFFER_WRITE, mme9097_query_buffer_write); - MK_MACRO(NVC0_COMPUTE_MACRO_LAUNCH_GRID_INDIRECT, mme90c0_launch_grid_indirect); + MK_MACRO(NVC0_CP_MACRO_LAUNCH_GRID_INDIRECT, mme90c0_launch_grid_indirect); BEGIN_NVC0(push, NVC0_3D(RASTERIZE_ENABLE), 1); PUSH_DATA (push, 1); -- 2.6.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/5] android: radeonsi: fix building error in si_shader.c
Hi Micheal, no problem, I'm learning so much and you and Emil have both shown amounts of patience with me. I've tested the following patch and it works Mauro >From a00b1182fd74ec6af37e09e53dd3febec36af27d Mon Sep 17 00:00:00 2001 From: Mauro Rossi Date: Sun, 21 Feb 2016 20:31:21 +0100 Subject: [PATCH] radeonsi: use util_strchrnul() to fix android building error Android Bionic does not support strchrnul() string function, gallium auxiliary util/u_string.h provides util_strchrnul() This change avoids the following building error: external/mesa/src/gallium/drivers/radeonsi/si_shader.c:3863: error: undefined reference to 'strchrnul' collect2: error: ld returned 1 exit status --- src/gallium/drivers/radeonsi/si_shader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index d1482de..192a736 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -39,6 +39,7 @@ #include "radeon/radeon_llvm_emit.h" #include "util/u_memory.h" #include "util/u_pstipple.h" +#include "util/u_string.h" #include "tgsi/tgsi_parse.h" #include "tgsi/tgsi_util.h" #include "tgsi/tgsi_dump.h" @@ -4019,7 +4020,7 @@ static void si_shader_dump_disassembly(const struct radeon_shader_binary *binary line = binary->disasm_string; while (*line) { -p = strchrnul(line, '\n'); +p = util_strchrnul(line, '\n'); count = p - line; if (count) { -- 2.5.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v3 02/14] nvc0: bind constant buffers for compute on Fermi
On Wed, Feb 17, 2016 at 4:27 PM, Samuel Pitoiset wrote: > Loosely based on 3D. > > Changs from v3: > - invalidate COMPUTE CBs after validating 3D CBs because they are >aliased > > Changes from v2: > - get rid of the 's' param to nvc0_cb_bo_push() because it doesn't >matter to upload constbufs for compute using the 3d chan > > Signed-off-by: Samuel Pitoiset > --- > src/gallium/drivers/nouveau/nvc0/nvc0_compute.c| 72 > +++--- > src/gallium/drivers/nouveau/nvc0/nvc0_context.c| 11 +++- > src/gallium/drivers/nouveau/nvc0/nvc0_screen.h | 2 +- > src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 4 +- > .../drivers/nouveau/nvc0/nvc0_state_validate.c | 5 ++ > 5 files changed, 81 insertions(+), 13 deletions(-) > > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c > b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c > index 5c7dc0e..0fe6353 100644 > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c > @@ -138,11 +138,71 @@ nvc0_compute_validate_program(struct nvc0_context *nvc0) > return false; > } > > +static void > +nvc0_compute_validate_constbufs(struct nvc0_context *nvc0) > +{ > + struct nouveau_pushbuf *push = nvc0->base.pushbuf; > + const int s = 5; > + > + while (nvc0->constbuf_dirty[s]) { > + int i = ffs(nvc0->constbuf_dirty[s]) - 1; > + nvc0->constbuf_dirty[s] &= ~(1 << i); > + > + if (nvc0->constbuf[s][i].user) { > + struct nouveau_bo *bo = nvc0->screen->uniform_bo; > + const unsigned base = s << 16; > + const unsigned size = nvc0->constbuf[s][0].size; > + assert(i == 0); /* we really only want OpenGL uniforms here */ > + assert(nvc0->constbuf[s][0].u.data); > + > + if (nvc0->state.uniform_buffer_bound[s] < size) { > +nvc0->state.uniform_buffer_bound[s] = align(size, 0x100); > + > +BEGIN_NVC0(push, NVC0_COMPUTE(CB_SIZE), 3); > +PUSH_DATA (push, nvc0->state.uniform_buffer_bound[s]); > +PUSH_DATAh(push, bo->offset + base); > +PUSH_DATA (push, bo->offset + base); > +BEGIN_NVC0(push, NVC0_COMPUTE(CB_BIND), 1); > +PUSH_DATA (push, (0 << 8) | 1); > + } > + nvc0_cb_bo_push(&nvc0->base, bo, > NV_VRAM_DOMAIN(&nvc0->screen->base), > + base, nvc0->state.uniform_buffer_bound[s], > + 0, (size + 3) / 4, > + nvc0->constbuf[s][0].u.data); > + } else { > + struct nv04_resource *res = > +nv04_resource(nvc0->constbuf[s][i].u.buf); > + if (res) { > +BEGIN_NVC0(push, NVC0_COMPUTE(CB_SIZE), 3); > +PUSH_DATA (push, nvc0->constbuf[s][i].size); > +PUSH_DATAh(push, res->address + nvc0->constbuf[s][i].offset); > +PUSH_DATA (push, res->address + nvc0->constbuf[s][i].offset); > +BEGIN_NVC0(push, NVC0_COMPUTE(CB_BIND), 1); > +PUSH_DATA (push, (i << 8) | 1); > + > +BCTX_REFN(nvc0->bufctx_cp, CP_CB(i), res, RD); > + > +res->cb_bindings[s] |= 1 << i; > + } else { > +BEGIN_NVC0(push, NVC0_COMPUTE(CB_BIND), 1); > +PUSH_DATA (push, (i << 8) | 0); > + } > + if (i == 0) > +nvc0->state.uniform_buffer_bound[s] = 0; > + } > + } > + > + BEGIN_NVC0(push, NVC0_COMPUTE(FLUSH), 1); > + PUSH_DATA (push, NVC0_COMPUTE_FLUSH_CB); > +} > + > static bool > nvc0_compute_state_validate(struct nvc0_context *nvc0) > { > if (!nvc0_compute_validate_program(nvc0)) >return false; > + if (nvc0->dirty_cp & NVC0_NEW_CP_CONSTBUF) > + nvc0_compute_validate_constbufs(nvc0); > > /* TODO: textures, samplers, surfaces, global memory buffers */ > > @@ -188,7 +248,7 @@ nvc0_launch_grid(struct pipe_context *pipe, const struct > pipe_grid_info *info) > struct nvc0_context *nvc0 = nvc0_context(pipe); > struct nouveau_pushbuf *push = nvc0->base.pushbuf; > struct nvc0_program *cp = nvc0->compprog; > - unsigned s, i; > + unsigned s; > int ret; > > ret = !nvc0_compute_state_validate(nvc0); > @@ -242,14 +302,10 @@ nvc0_launch_grid(struct pipe_context *pipe, const > struct pipe_grid_info *info) > BEGIN_NVC0(push, SUBC_COMPUTE(0x0360), 1); > PUSH_DATA (push, 0x1); > > - /* rebind all the 3D constant buffers > -* (looks like binding a CB on COMPUTE clobbers 3D state) */ > + /* Invalidate all 3D constbufs because they are aliased with COMPUTE. */ > nvc0->dirty |= NVC0_NEW_CONSTBUF; > for (s = 0; s < 5; s++) { > - for (i = 0; i < NVC0_MAX_PIPE_CONSTBUFS; i++) > - if (nvc0->constbuf[s][i].u.buf) > -nvc0->constbuf_dirty[s] |= 1 << i; > + nvc0->constbuf_dirty[s] |= nvc0->constbuf_valid[s]; > + nvc0->state.uniform_buffer_bound[s] = 0; > } > - memset(nvc0->state.uniform_buffer_bound, 0, > - sizeof(nvc0->state
[Mesa-dev] [PATCH 4/5] nvc0: rename 3d dirty flags to NVC0_NEW_3D_XXX
Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c| 4 +- src/gallium/drivers/nouveau/nvc0/nvc0_context.c| 18 ++--- src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 58 +++--- .../drivers/nouveau/nvc0/nvc0_shader_state.c | 4 +- src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 56 +++--- .../drivers/nouveau/nvc0/nvc0_state_validate.c | 88 +++--- src/gallium/drivers/nouveau/nvc0/nvc0_surface.c| 30 src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c| 8 +- 8 files changed, 133 insertions(+), 133 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index 112f1c4..0f1265f 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -239,7 +239,7 @@ nvc0_compute_validate_driverconst(struct nvc0_context *nvc0) BEGIN_NVC0(push, NVC0_CP(CB_BIND), 1); PUSH_DATA (push, (15 << 8) | 1); - nvc0->dirty_3d |= NVC0_NEW_DRIVERCONST; + nvc0->dirty_3d |= NVC0_NEW_3D_DRIVERCONST; } static void @@ -403,7 +403,7 @@ nvc0_launch_grid(struct pipe_context *pipe, const struct pipe_grid_info *info) } /* Invalidate all 3D constbufs because they are aliased with COMPUTE. */ - nvc0->dirty_3d |= NVC0_NEW_CONSTBUF; + nvc0->dirty_3d |= NVC0_NEW_3D_CONSTBUF; for (s = 0; s < 5; s++) { nvc0->constbuf_dirty[s] |= nvc0->constbuf_valid[s]; nvc0->state.uniform_buffer_bound[s] = 0; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c index 16c0835..9860e2d 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c @@ -194,7 +194,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, for (i = 0; i < nvc0->framebuffer.nr_cbufs; ++i) { if (nvc0->framebuffer.cbufs[i] && nvc0->framebuffer.cbufs[i]->texture == res) { -nvc0->dirty_3d |= NVC0_NEW_FRAMEBUFFER; +nvc0->dirty_3d |= NVC0_NEW_3D_FRAMEBUFFER; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB); if (!--ref) return ref; @@ -204,7 +204,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (res->bind & PIPE_BIND_DEPTH_STENCIL) { if (nvc0->framebuffer.zsbuf && nvc0->framebuffer.zsbuf->texture == res) { - nvc0->dirty_3d |= NVC0_NEW_FRAMEBUFFER; + nvc0->dirty_3d |= NVC0_NEW_3D_FRAMEBUFFER; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB); if (!--ref) return ref; @@ -214,7 +214,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (res->target == PIPE_BUFFER) { for (i = 0; i < nvc0->num_vtxbufs; ++i) { if (nvc0->vtxbuf[i].buffer == res) { -nvc0->dirty_3d |= NVC0_NEW_ARRAYS; +nvc0->dirty_3d |= NVC0_NEW_3D_ARRAYS; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_VTX); if (!--ref) return ref; @@ -222,7 +222,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, } if (nvc0->idxbuf.buffer == res) { - nvc0->dirty_3d |= NVC0_NEW_IDXBUF; + nvc0->dirty_3d |= NVC0_NEW_3D_IDXBUF; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_IDX); if (!--ref) return ref; @@ -233,7 +233,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (nvc0->textures[s][i] && nvc0->textures[s][i]->texture == res) { nvc0->textures_dirty[s] |= 1 << i; -nvc0->dirty_3d |= NVC0_NEW_TEXTURES; +nvc0->dirty_3d |= NVC0_NEW_3D_TEXTURES; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_TEX(s, i)); if (!--ref) return ref; @@ -252,7 +252,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, nvc0->dirty_cp |= NVC0_NEW_CP_CONSTBUF; nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_CB(i)); } else { - nvc0->dirty_3d |= NVC0_NEW_CONSTBUF; + nvc0->dirty_3d |= NVC0_NEW_3D_CONSTBUF; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_CB(s, i)); } if (!--ref) @@ -269,7 +269,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, nvc0->dirty_cp |= NVC0_NEW_CP_BUFFERS; nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_BUF); } else { - nvc0->dirty_3d |= NVC0_NEW_BUFFERS; + nvc0->dirty_3d |= NVC0_NEW_3D_BUFFERS; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_BUF); } if (!--ref) @@ -352,12 +352,12 @@ nvc0_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags) if (!nvc0->tcp_empty) goto out_err; /* se
[Mesa-dev] [PATCH 5/6] nvc0: rework the validation path for 3D
This will be used to rework the validation path for compute. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/Makefile.sources | 1 + src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 3 -- .../drivers/nouveau/nvc0/nvc0_state_validate.c | 38 ++ .../drivers/nouveau/nvc0/nvc0_state_validate.h | 19 +++ src/gallium/drivers/nouveau/nvc0/nvc0_surface.c| 5 +-- src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c| 3 +- 6 files changed, 49 insertions(+), 20 deletions(-) create mode 100644 src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.h diff --git a/src/gallium/drivers/nouveau/Makefile.sources b/src/gallium/drivers/nouveau/Makefile.sources index 31a9365..dc7dc0b 100644 --- a/src/gallium/drivers/nouveau/Makefile.sources +++ b/src/gallium/drivers/nouveau/Makefile.sources @@ -177,6 +177,7 @@ NVC0_C_SOURCES := \ nvc0/nvc0_state.c \ nvc0/nvc0_stateobj.h \ nvc0/nvc0_state_validate.c \ + nvc0/nvc0_state_validate.h \ nvc0/nvc0_surface.c \ nvc0/nvc0_tex.c \ nvc0/nvc0_transfer.c \ diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h index 542d644..e88cece 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h @@ -261,9 +261,6 @@ void nvc0_tfb_validate(struct nvc0_context *); /* nvc0_state.c */ extern void nvc0_init_state_functions(struct nvc0_context *); -/* nvc0_state_validate.c */ -bool nvc0_state_validate(struct nvc0_context *, uint32_t state_mask); - /* nvc0_surface.c */ extern void nvc0_clear(struct pipe_context *, unsigned buffers, const union pipe_color_union *color, diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c index e9a4f7c..2c4327e 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c @@ -3,6 +3,7 @@ #include "util/u_math.h" #include "nvc0/nvc0_context.h" +#include "nvc0/nvc0_state_validate.h" #if 0 static void @@ -672,10 +673,8 @@ nvc0_switch_pipe_context(struct nvc0_context *ctx_to) ctx_to->screen->cur_ctx = ctx_to; } -static struct state_validate { -void (*func)(struct nvc0_context *); -uint32_t states; -} validate_list[] = { +static struct nvc0_state_validate +validate_list_3d[] = { { nvc0_validate_fb,NVC0_NEW_3D_FRAMEBUFFER }, { nvc0_validate_blend, NVC0_NEW_3D_BLEND }, { nvc0_validate_zsa, NVC0_NEW_3D_ZSA }, @@ -714,7 +713,10 @@ static struct state_validate { }; bool -nvc0_state_validate(struct nvc0_context *nvc0, uint32_t mask) +nvc0_state_validate(struct nvc0_context *nvc0, uint32_t mask, +struct nvc0_state_validate *validate_list, int size, +uint32_t *dirty, bool *flushed, +struct nouveau_bufctx *bufctx) { uint32_t state_mask; int ret; @@ -723,26 +725,34 @@ nvc0_state_validate(struct nvc0_context *nvc0, uint32_t mask) if (nvc0->screen->cur_ctx != nvc0) nvc0_switch_pipe_context(nvc0); - state_mask = nvc0->dirty_3d & mask; + state_mask = *dirty & mask; if (state_mask) { - for (i = 0; i < ARRAY_SIZE(validate_list); ++i) { - struct state_validate *validate = &validate_list[i]; + for (i = 0; i < size; ++i) { + struct nvc0_state_validate *validate = &validate_list[i]; if (state_mask & validate->states) validate->func(nvc0); } - nvc0->dirty_3d &= ~state_mask; + *dirty &= ~state_mask; - nvc0_bufctx_fence(nvc0, nvc0->bufctx_3d, false); + nvc0_bufctx_fence(nvc0, bufctx, false); } - nouveau_pushbuf_bufctx(nvc0->base.pushbuf, nvc0->bufctx_3d); + nouveau_pushbuf_bufctx(nvc0->base.pushbuf, bufctx); ret = nouveau_pushbuf_validate(nvc0->base.pushbuf); - if (unlikely(nvc0->state.flushed_3d)) { - nvc0->state.flushed_3d = false; - nvc0_bufctx_fence(nvc0, nvc0->bufctx_3d, true); + if (unlikely(*flushed)) { + *flushed = false; + nvc0_bufctx_fence(nvc0, bufctx, true); } return !ret; } + +bool +nvc0_state_validate_3d(struct nvc0_context *nvc0, uint32_t mask) +{ + return nvc0_state_validate(nvc0, mask, validate_list_3d, + ARRAY_SIZE(validate_list_3d), &nvc0->dirty_3d, + &nvc0->state.flushed_3d, nvc0->bufctx_3d); +} diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.h b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.h new file mode 100644 index 000..d40d81d --- /dev/null +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.h @@ -0,0 +1,19 @@ +#ifndef __NVC0_STATE_VALIDATE_H__ +#define __NVC0_STATE_VALIDATE_H__ + +#include "nvc0/nvc0_context.h" + +struct nvc0_state_validate { + void (*func)(struct nvc0_context *); + u
[Mesa-dev] [PATCH] nv50/ir: restore OP_SELP to be a regular instruction
Actually OP_SELP doesn't need to be a compare instruction. Instead we just need to set the NOT modifier when building the instruction. While we are at it, fix the dst register type and use a GPR. Suggested by Ilia Mirkin. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp| 8 src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 8 src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h | 4 ++-- src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 8 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp index 8268e08..a78b3f9 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp @@ -112,7 +112,7 @@ private: void emitSET(const CmpInstruction *); void emitSLCT(const CmpInstruction *); - void emitSELP(const CmpInstruction *); + void emitSELP(const Instruction *); void emitTEXBAR(const Instruction *); void emitTEX(const TexInstruction *); @@ -1045,11 +1045,11 @@ CodeEmitterGK110::emitSLCT(const CmpInstruction *i) } } -void CodeEmitterGK110::emitSELP(const CmpInstruction *i) +void CodeEmitterGK110::emitSELP(const Instruction *i) { emitForm_21(i, 0x250, 0x050); - if ((i->setCond == CC_NOT_P) ^ (bool)(i->src(2).mod & Modifier(NV50_IR_MOD_NOT))) + if (i->src(2).mod & Modifier(NV50_IR_MOD_NOT)) code[1] |= 1 << 13; } @@ -1937,7 +1937,7 @@ CodeEmitterGK110::emitInstruction(Instruction *insn) emitSET(insn->asCmp()); break; case OP_SELP: - emitSELP(insn->asCmp()); + emitSELP(insn); break; case OP_SLCT: emitSLCT(insn->asCmp()); diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp index d588d7e..65fcd64 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp @@ -120,7 +120,7 @@ private: void emitSET(const CmpInstruction *); void emitSLCT(const CmpInstruction *); - void emitSELP(const CmpInstruction *); + void emitSELP(const Instruction *); void emitTEXBAR(const Instruction *); void emitTEX(const TexInstruction *); @@ -1175,11 +1175,11 @@ CodeEmitterNVC0::emitSLCT(const CmpInstruction *i) code[0] |= 1 << 5; } -void CodeEmitterNVC0::emitSELP(const CmpInstruction *i) +void CodeEmitterNVC0::emitSELP(const Instruction *i) { emitForm_A(i, HEX64(2000, 0004)); - if (i->setCond == CC_NOT_P || i->src(2).mod & Modifier(NV50_IR_MOD_NOT)) + if (i->src(2).mod & Modifier(NV50_IR_MOD_NOT)) code[1] |= 1 << 20; } @@ -2438,7 +2438,7 @@ CodeEmitterNVC0::emitInstruction(Instruction *insn) emitSET(insn->asCmp()); break; case OP_SELP: - emitSELP(insn->asCmp()); + emitSELP(insn); break; case OP_SLCT: emitSLCT(insn->asCmp()); diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h b/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h index 02e6157..e465f24 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h @@ -281,14 +281,14 @@ Value *TexInstruction::getIndirectS() const CmpInstruction *Instruction::asCmp() { - if (op >= OP_SET_AND && op <= OP_SLCT) + if (op >= OP_SET_AND && op <= OP_SLCT && op != OP_SELP) return static_cast(this); return NULL; } const CmpInstruction *Instruction::asCmp() const { - if (op >= OP_SET_AND && op <= OP_SLCT) + if (op >= OP_SET_AND && op <= OP_SLCT && op != OP_SELP) return static_cast(this); return NULL; } diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp index 21a6f1e..d181f15 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp @@ -1067,10 +1067,10 @@ NVC0LoweringPass::handleSharedATOM(Instruction *atom) TYPE_U32, ld->getDef(0), atom->getSrc(1)); set->setPredicate(CC_P, ld->getDef(1)); - CmpInstruction *selp = - bld.mkCmp(OP_SELP, CC_NOT_P, TYPE_U32, bld.getSSA(4, FILE_ADDRESS), - TYPE_U32, ld->getDef(0), atom->getSrc(2), - set->getDef(0)); + Instruction *selp = + bld.mkOp3(OP_SELP, TYPE_U32, bld.getSSA(), ld->getDef(0), + atom->getSrc(2), set->getDef(0)); + selp->src(2).mod = Modifier(NV50_IR_MOD_NOT); selp->setPredicate(CC_P, ld->getDef(1)); stVal = selp->getDef(0); -- 2.6.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mai
[Mesa-dev] [PATCH 5/5] nvc0: rename 3d binding points to NVC0_BIND_3D_XXX
Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_context.c| 28 +++--- src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 24 +-- .../drivers/nouveau/nvc0/nvc0_shader_state.c | 8 +++ src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 18 +++--- .../drivers/nouveau/nvc0/nvc0_state_validate.c | 10 src/gallium/drivers/nouveau/nvc0/nvc0_surface.c| 17 ++--- src/gallium/drivers/nouveau/nvc0/nvc0_tex.c| 4 ++-- src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c| 14 +-- .../drivers/nouveau/nvc0/nvc0_vbo_translate.c | 6 ++--- 9 files changed, 65 insertions(+), 64 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c index 9860e2d..f33d29d 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c @@ -195,7 +195,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (nvc0->framebuffer.cbufs[i] && nvc0->framebuffer.cbufs[i]->texture == res) { nvc0->dirty_3d |= NVC0_NEW_3D_FRAMEBUFFER; -nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB); +nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_FB); if (!--ref) return ref; } @@ -205,7 +205,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (nvc0->framebuffer.zsbuf && nvc0->framebuffer.zsbuf->texture == res) { nvc0->dirty_3d |= NVC0_NEW_3D_FRAMEBUFFER; - nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB); + nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_FB); if (!--ref) return ref; } @@ -215,7 +215,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, for (i = 0; i < nvc0->num_vtxbufs; ++i) { if (nvc0->vtxbuf[i].buffer == res) { nvc0->dirty_3d |= NVC0_NEW_3D_ARRAYS; -nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_VTX); +nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_VTX); if (!--ref) return ref; } @@ -223,7 +223,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (nvc0->idxbuf.buffer == res) { nvc0->dirty_3d |= NVC0_NEW_3D_IDXBUF; - nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_IDX); + nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_IDX); if (!--ref) return ref; } @@ -234,7 +234,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, nvc0->textures[s][i]->texture == res) { nvc0->textures_dirty[s] |= 1 << i; nvc0->dirty_3d |= NVC0_NEW_3D_TEXTURES; -nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_TEX(s, i)); +nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_TEX(s, i)); if (!--ref) return ref; } @@ -253,7 +253,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_CB(i)); } else { nvc0->dirty_3d |= NVC0_NEW_3D_CONSTBUF; - nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_CB(s, i)); + nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_CB(s, i)); } if (!--ref) return ref; @@ -270,7 +270,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_BUF); } else { nvc0->dirty_3d |= NVC0_NEW_3D_BUFFERS; - nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_BUF); + nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_BUF); } if (!--ref) return ref; @@ -308,7 +308,7 @@ nvc0_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags) ret = nouveau_bufctx_new(screen->base.client, 2, &nvc0->bufctx); if (!ret) - ret = nouveau_bufctx_new(screen->base.client, NVC0_BIND_3D_COUNT, + ret = nouveau_bufctx_new(screen->base.client, NVC0_BIND_3D_3D_COUNT, &nvc0->bufctx_3d); if (!ret) ret = nouveau_bufctx_new(screen->base.client, NVC0_BIND_CP_COUNT, @@ -357,7 +357,7 @@ nvc0_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags) /* Do not bind the COMPUTE driver constbuf at screen initialization because * CBs are aliased between 3D and COMPUTE, but make sure it will be bound if * a grid is launched later. */ - nvc0->dirty_cp |= NVC0_NEW_3D_DRIVERCONST; + nvc0->dirty_cp |= NVC0_NEW_CP_DRIVERCONST; /* now that there are no more opportunities for errors, set the current * context if there isn't already one. @@ -373,9 +373,9 @@ nvc0_create(struct pipe_screen *pscreen, vo
Re: [Mesa-dev] [PATCH v3 12/14] nv50/ir: make OP_SELP a compare instruction
Sooo I know I'm the one who suggested this change in the first place. But having slept on it, I think this is wrong. The point of a CmpInstruction is when you're comparing two things and you need a comparison operator and stuff like that. This is a much simpler situation -- you can only have a NOT. Or not have a NOT :) This is already well-expressed using a modifier. Furthermore I think there are opt passes which might do clever things with Cmp instructions... not sure. So what I propose is to: (a) flip it back to a regular instruction (b) remove the i->setCond bit of the emission condition, only use the modifier [the original problem was it was using i->cc which is also wrong] (c) have the creator of the operation set the NOT modifier as necessary. [And again, this is totally my bad... I told you to do this, and then gave you a R-b on it...] -ilia On Wed, Feb 17, 2016 at 4:27 PM, Samuel Pitoiset wrote: > This OP_SELP insn will be used to handle compare and swap subops. > > Signed-off-by: Samuel Pitoiset > --- > src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 8 > src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h | 4 ++-- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp > b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp > index a7c49a2..6566d24 100644 > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp > @@ -120,7 +120,7 @@ private: > > void emitSET(const CmpInstruction *); > void emitSLCT(const CmpInstruction *); > - void emitSELP(const Instruction *); > + void emitSELP(const CmpInstruction *); > > void emitTEXBAR(const Instruction *); > void emitTEX(const TexInstruction *); > @@ -1170,11 +1170,11 @@ CodeEmitterNVC0::emitSLCT(const CmpInstruction *i) >code[0] |= 1 << 5; > } > > -void CodeEmitterNVC0::emitSELP(const Instruction *i) > +void CodeEmitterNVC0::emitSELP(const CmpInstruction *i) > { > emitForm_A(i, HEX64(2000, 0004)); > > - if (i->cc == CC_NOT_P || i->src(2).mod & Modifier(NV50_IR_MOD_NOT)) > + if (i->setCond == CC_NOT_P || i->src(2).mod & Modifier(NV50_IR_MOD_NOT)) >code[1] |= 1 << 20; > } > > @@ -2433,7 +2433,7 @@ CodeEmitterNVC0::emitInstruction(Instruction *insn) >emitSET(insn->asCmp()); >break; > case OP_SELP: > - emitSELP(insn); > + emitSELP(insn->asCmp()); >break; > case OP_SLCT: >emitSLCT(insn->asCmp()); > diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h > b/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h > index e465f24..02e6157 100644 > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h > @@ -281,14 +281,14 @@ Value *TexInstruction::getIndirectS() const > > CmpInstruction *Instruction::asCmp() > { > - if (op >= OP_SET_AND && op <= OP_SLCT && op != OP_SELP) > + if (op >= OP_SET_AND && op <= OP_SLCT) >return static_cast(this); > return NULL; > } > > const CmpInstruction *Instruction::asCmp() const > { > - if (op >= OP_SET_AND && op <= OP_SLCT && op != OP_SELP) > + if (op >= OP_SET_AND && op <= OP_SLCT) >return static_cast(this); > return NULL; > } > -- > 2.6.4 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/5] nvc0: rename NVXX_COMPUTE to NVXX_CP
Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c| 96 ++--- .../drivers/nouveau/nvc0/nvc0_query_hw_sm.c| 28 +++ src/gallium/drivers/nouveau/nvc0/nvc0_tex.c| 6 +- src/gallium/drivers/nouveau/nvc0/nvc0_winsys.h | 6 +- src/gallium/drivers/nouveau/nvc0/nve4_compute.c| 98 +++--- 5 files changed, 117 insertions(+), 117 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index 26304ad..3f7a7d3 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -59,60 +59,60 @@ nvc0_screen_compute_setup(struct nvc0_screen *screen, if (ret) return ret; - BEGIN_NVC0(push, SUBC_COMPUTE(NV01_SUBCHAN_OBJECT), 1); + BEGIN_NVC0(push, SUBC_CP(NV01_SUBCHAN_OBJECT), 1); PUSH_DATA (push, screen->compute->oclass); /* hardware limit */ - BEGIN_NVC0(push, NVC0_COMPUTE(MP_LIMIT), 1); + BEGIN_NVC0(push, NVC0_CP(MP_LIMIT), 1); PUSH_DATA (push, screen->mp_count); - BEGIN_NVC0(push, NVC0_COMPUTE(CALL_LIMIT_LOG), 1); + BEGIN_NVC0(push, NVC0_CP(CALL_LIMIT_LOG), 1); PUSH_DATA (push, 0xf); - BEGIN_NVC0(push, SUBC_COMPUTE(0x02a0), 1); + BEGIN_NVC0(push, SUBC_CP(0x02a0), 1); PUSH_DATA (push, 0x8000); /* global memory setup */ - BEGIN_NVC0(push, SUBC_COMPUTE(0x02c4), 1); + BEGIN_NVC0(push, SUBC_CP(0x02c4), 1); PUSH_DATA (push, 0); - BEGIN_NIC0(push, NVC0_COMPUTE(GLOBAL_BASE), 0x100); + BEGIN_NIC0(push, NVC0_CP(GLOBAL_BASE), 0x100); for (i = 0; i <= 0xff; i++) PUSH_DATA (push, (0xc << 28) | (i << 16) | i); - BEGIN_NVC0(push, SUBC_COMPUTE(0x02c4), 1); + BEGIN_NVC0(push, SUBC_CP(0x02c4), 1); PUSH_DATA (push, 1); /* local memory and cstack setup */ - BEGIN_NVC0(push, NVC0_COMPUTE(TEMP_ADDRESS_HIGH), 2); + BEGIN_NVC0(push, NVC0_CP(TEMP_ADDRESS_HIGH), 2); PUSH_DATAh(push, screen->tls->offset); PUSH_DATA (push, screen->tls->offset); - BEGIN_NVC0(push, NVC0_COMPUTE(TEMP_SIZE_HIGH), 2); + BEGIN_NVC0(push, NVC0_CP(TEMP_SIZE_HIGH), 2); PUSH_DATAh(push, screen->tls->size); PUSH_DATA (push, screen->tls->size); - BEGIN_NVC0(push, NVC0_COMPUTE(WARP_TEMP_ALLOC), 1); + BEGIN_NVC0(push, NVC0_CP(WARP_TEMP_ALLOC), 1); PUSH_DATA (push, 0); - BEGIN_NVC0(push, NVC0_COMPUTE(LOCAL_BASE), 1); + BEGIN_NVC0(push, NVC0_CP(LOCAL_BASE), 1); PUSH_DATA (push, 0xff << 24); /* shared memory setup */ - BEGIN_NVC0(push, NVC0_COMPUTE(CACHE_SPLIT), 1); + BEGIN_NVC0(push, NVC0_CP(CACHE_SPLIT), 1); PUSH_DATA (push, NVC0_COMPUTE_CACHE_SPLIT_48K_SHARED_16K_L1); - BEGIN_NVC0(push, NVC0_COMPUTE(SHARED_BASE), 1); + BEGIN_NVC0(push, NVC0_CP(SHARED_BASE), 1); PUSH_DATA (push, 0xfe << 24); - BEGIN_NVC0(push, NVC0_COMPUTE(SHARED_SIZE), 1); + BEGIN_NVC0(push, NVC0_CP(SHARED_SIZE), 1); PUSH_DATA (push, 0); /* code segment setup */ - BEGIN_NVC0(push, NVC0_COMPUTE(CODE_ADDRESS_HIGH), 2); + BEGIN_NVC0(push, NVC0_CP(CODE_ADDRESS_HIGH), 2); PUSH_DATAh(push, screen->text->offset); PUSH_DATA (push, screen->text->offset); /* textures */ - BEGIN_NVC0(push, NVC0_COMPUTE(TIC_ADDRESS_HIGH), 3); + BEGIN_NVC0(push, NVC0_CP(TIC_ADDRESS_HIGH), 3); PUSH_DATAh(push, screen->txc->offset); PUSH_DATA (push, screen->txc->offset); PUSH_DATA (push, NVC0_TIC_MAX_ENTRIES - 1); /* samplers */ - BEGIN_NVC0(push, NVC0_COMPUTE(TSC_ADDRESS_HIGH), 3); + BEGIN_NVC0(push, NVC0_CP(TSC_ADDRESS_HIGH), 3); PUSH_DATAh(push, screen->txc->offset + 65536); PUSH_DATA (push, screen->txc->offset + 65536); PUSH_DATA (push, NVC0_TSC_MAX_ENTRIES - 1); @@ -140,7 +140,7 @@ nvc0_compute_validate_program(struct nvc0_context *nvc0) if (likely(prog->code_size)) { if (nvc0_program_upload_code(nvc0, prog)) { struct nouveau_pushbuf *push = nvc0->base.pushbuf; - BEGIN_NVC0(push, NVC0_COMPUTE(FLUSH), 1); + BEGIN_NVC0(push, NVC0_CP(FLUSH), 1); PUSH_DATA (push, NVC0_COMPUTE_FLUSH_CODE); return true; } @@ -153,7 +153,7 @@ nvc0_compute_validate_samplers(struct nvc0_context *nvc0) { bool need_flush = nvc0_validate_tsc(nvc0, 5); if (need_flush) { - BEGIN_NVC0(nvc0->base.pushbuf, NVC0_COMPUTE(TSC_FLUSH), 1); + BEGIN_NVC0(nvc0->base.pushbuf, NVC0_CP(TSC_FLUSH), 1); PUSH_DATA (nvc0->base.pushbuf, 0); } } @@ -163,7 +163,7 @@ nvc0_compute_validate_textures(struct nvc0_context *nvc0) { bool need_flush = nvc0_validate_tic(nvc0, 5); if (need_flush) { - BEGIN_NVC0(nvc0->base.pushbuf, NVC0_COMPUTE(TIC_FLUSH), 1); + BEGIN_NVC0(nvc0->base.pushbuf, NVC0_CP(TIC_FLUSH), 1); PUSH_DATA (nvc0->base.pushbuf, 0); } } @@ -188,11 +188,11 @@ nvc0_compute_validate_constbufs(struct nvc0_context *nvc0) if (nvc0->state.uniform_buffer_bound[s] < size) { nvc0->state.uniform_buffer_bound[
[Mesa-dev] [PATCH 1/5] nvc0: rename nvc0_context::dirty to nvc0_context::dirty_3d
Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c| 4 +- src/gallium/drivers/nouveau/nvc0/nvc0_context.c| 16 +++ src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 2 +- .../drivers/nouveau/nvc0/nvc0_shader_state.c | 4 +- src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 56 +++--- .../drivers/nouveau/nvc0/nvc0_state_validate.c | 24 +- src/gallium/drivers/nouveau/nvc0/nvc0_surface.c| 14 +++--- src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c| 8 ++-- 8 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index c07f186..26304ad 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -239,7 +239,7 @@ nvc0_compute_validate_driverconst(struct nvc0_context *nvc0) BEGIN_NVC0(push, NVC0_COMPUTE(CB_BIND), 1); PUSH_DATA (push, (15 << 8) | 1); - nvc0->dirty |= NVC0_NEW_DRIVERCONST; + nvc0->dirty_3d |= NVC0_NEW_DRIVERCONST; } static void @@ -403,7 +403,7 @@ nvc0_launch_grid(struct pipe_context *pipe, const struct pipe_grid_info *info) } /* Invalidate all 3D constbufs because they are aliased with COMPUTE. */ - nvc0->dirty |= NVC0_NEW_CONSTBUF; + nvc0->dirty_3d |= NVC0_NEW_CONSTBUF; for (s = 0; s < 5; s++) { nvc0->constbuf_dirty[s] |= nvc0->constbuf_valid[s]; nvc0->state.uniform_buffer_bound[s] = 0; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c index 66e7f95..16c0835 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c @@ -194,7 +194,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, for (i = 0; i < nvc0->framebuffer.nr_cbufs; ++i) { if (nvc0->framebuffer.cbufs[i] && nvc0->framebuffer.cbufs[i]->texture == res) { -nvc0->dirty |= NVC0_NEW_FRAMEBUFFER; +nvc0->dirty_3d |= NVC0_NEW_FRAMEBUFFER; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB); if (!--ref) return ref; @@ -204,7 +204,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (res->bind & PIPE_BIND_DEPTH_STENCIL) { if (nvc0->framebuffer.zsbuf && nvc0->framebuffer.zsbuf->texture == res) { - nvc0->dirty |= NVC0_NEW_FRAMEBUFFER; + nvc0->dirty_3d |= NVC0_NEW_FRAMEBUFFER; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB); if (!--ref) return ref; @@ -214,7 +214,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (res->target == PIPE_BUFFER) { for (i = 0; i < nvc0->num_vtxbufs; ++i) { if (nvc0->vtxbuf[i].buffer == res) { -nvc0->dirty |= NVC0_NEW_ARRAYS; +nvc0->dirty_3d |= NVC0_NEW_ARRAYS; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_VTX); if (!--ref) return ref; @@ -222,7 +222,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, } if (nvc0->idxbuf.buffer == res) { - nvc0->dirty |= NVC0_NEW_IDXBUF; + nvc0->dirty_3d |= NVC0_NEW_IDXBUF; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_IDX); if (!--ref) return ref; @@ -233,7 +233,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (nvc0->textures[s][i] && nvc0->textures[s][i]->texture == res) { nvc0->textures_dirty[s] |= 1 << i; -nvc0->dirty |= NVC0_NEW_TEXTURES; +nvc0->dirty_3d |= NVC0_NEW_TEXTURES; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_TEX(s, i)); if (!--ref) return ref; @@ -252,7 +252,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, nvc0->dirty_cp |= NVC0_NEW_CP_CONSTBUF; nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_CB(i)); } else { - nvc0->dirty |= NVC0_NEW_CONSTBUF; + nvc0->dirty_3d |= NVC0_NEW_CONSTBUF; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_CB(s, i)); } if (!--ref) @@ -269,7 +269,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, nvc0->dirty_cp |= NVC0_NEW_CP_BUFFERS; nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_BUF); } else { - nvc0->dirty |= NVC0_NEW_BUFFERS; + nvc0->dirty_3d |= NVC0_NEW_BUFFERS; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_BUF); } if (!--ref) @@ -352,7 +352,7 @@ nvc0_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags) if (!nvc0->tcp_empty) goto out_err; /* set the empty tctl prog on next draw in case one is never set */ -
[Mesa-dev] [PATCH 2/2] st/nine: Use position input helper for ps3 declared inputs
When the semantic is position (which can happen with index 0 only), use the helper to get position input. Signed-off-by: Axel Davy --- The other changes of the initial patch (forbid POSITION0, etc) will be part of another serie. src/gallium/state_trackers/nine/nine_shader.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index f0c5236..eb6479b 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -2052,9 +2052,16 @@ DECL_SPECIAL(DCL) unsigned interp_location = 0; /* SM3 only, SM2 input semantic determined by file */ assert(sem.reg.idx < Elements(tx->regs.v)); + +if (tgsi.Name == TGSI_SEMANTIC_POSITION) { +tx->regs.v[sem.reg.idx] = nine_get_position_input(tx); +return D3D_OK; +} + if (sem.reg.mod & NINED3DSPDM_CENTROID || (tgsi.Name == TGSI_SEMANTIC_COLOR && tx->info->force_color_in_centroid)) interp_location = TGSI_INTERPOLATE_LOC_CENTROID; + tx->regs.v[sem.reg.idx] = ureg_DECL_fs_input_cyl_centroid( ureg, tgsi.Name, tgsi.Index, nine_tgsi_to_interp_mode(&tgsi), -- 2.7.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 6/6] nvc0: add new validation path for compute
Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 44 + src/gallium/drivers/nouveau/nvc0/nve4_compute.c | 41 +-- 2 files changed, 31 insertions(+), 54 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index f76a10c..e9db9c9 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -24,6 +24,7 @@ #include "nvc0/nvc0_context.h" #include "nvc0/nvc0_compute.h" +#include "nvc0/nvc0_state_validate.h" int nvc0_screen_compute_setup(struct nvc0_screen *screen, @@ -259,35 +260,22 @@ nvc0_compute_validate_buffers(struct nvc0_context *nvc0) } } +static struct nvc0_state_validate +validate_list_cp[] = { + { nvc0_compute_validate_program, NVC0_NEW_CP_PROGRAM }, + { nvc0_compute_validate_constbufs, NVC0_NEW_CP_CONSTBUF }, + { nvc0_compute_validate_driverconst, NVC0_NEW_CP_DRIVERCONST }, + { nvc0_compute_validate_buffers, NVC0_NEW_CP_BUFFERS }, + { nvc0_compute_validate_textures, NVC0_NEW_CP_TEXTURES }, + { nvc0_compute_validate_samplers, NVC0_NEW_CP_SAMPLERS }, +}; + static bool -nvc0_compute_state_validate(struct nvc0_context *nvc0) +nvc0_state_validate_cp(struct nvc0_context *nvc0, uint32_t mask) { - nvc0_compute_validate_program(nvc0); - if (nvc0->dirty_cp & NVC0_NEW_CP_CONSTBUF) - nvc0_compute_validate_constbufs(nvc0); - if (nvc0->dirty_cp & NVC0_NEW_CP_DRIVERCONST) - nvc0_compute_validate_driverconst(nvc0); - if (nvc0->dirty_cp & NVC0_NEW_CP_BUFFERS) - nvc0_compute_validate_buffers(nvc0); - if (nvc0->dirty_cp & NVC0_NEW_CP_TEXTURES) - nvc0_compute_validate_textures(nvc0); - if (nvc0->dirty_cp & NVC0_NEW_CP_SAMPLERS) - nvc0_compute_validate_samplers(nvc0); - - /* TODO: surfaces, global memory buffers */ - - nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, false); - - nouveau_pushbuf_bufctx(nvc0->base.pushbuf, nvc0->bufctx_cp); - if (unlikely(nouveau_pushbuf_validate(nvc0->base.pushbuf))) - return false; - if (unlikely(nvc0->state.flushed_cp)) { - nvc0->state.flushed_cp = false; - nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, true); - } - - return true; - + return nvc0_state_validate(nvc0, mask, validate_list_cp, + ARRAY_SIZE(validate_list_cp), &nvc0->dirty_cp, + &nvc0->state.flushed_cp, nvc0->bufctx_cp); } static void @@ -323,7 +311,7 @@ nvc0_launch_grid(struct pipe_context *pipe, const struct pipe_grid_info *info) unsigned s; int ret; - ret = !nvc0_compute_state_validate(nvc0); + ret = !nvc0_state_validate_cp(nvc0, ~0); if (ret) { NOUVEAU_ERR("Failed to launch grid !\n"); return; diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c index fae8c60..035ecf2 100644 --- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c @@ -24,6 +24,7 @@ #include "nvc0/nvc0_context.h" #include "nvc0/nvc0_compute.h" +#include "nvc0/nvc0_state_validate.h" #include "nvc0/nve4_compute.h" #include "codegen/nv50_ir_driver.h" @@ -317,36 +318,24 @@ nvc0_compute_validate_globals(struct nvc0_context *nvc0) } } +static struct nvc0_state_validate +validate_list_cp[] = { + { nvc0_compute_validate_program,NVC0_NEW_CP_PROGRAM }, + { nve4_compute_validate_textures, NVC0_NEW_CP_TEXTURES }, + { nve4_compute_validate_samplers, NVC0_NEW_CP_SAMPLERS }, + { nve4_compute_set_tex_handles, NVC0_NEW_CP_TEXTURES | NVC0_NEW_CP_SAMPLERS }, + { nve4_compute_validate_surfaces, NVC0_NEW_CP_SURFACES }, + { nvc0_compute_validate_globals,NVC0_NEW_CP_GLOBALS }, +}; static bool -nve4_compute_state_validate(struct nvc0_context *nvc0) +nve4_state_validate_cp(struct nvc0_context *nvc0, uint32_t mask) { - nvc0_compute_validate_program(nvc0); - if (nvc0->dirty_cp & NVC0_NEW_CP_TEXTURES) - nve4_compute_validate_textures(nvc0); - if (nvc0->dirty_cp & NVC0_NEW_CP_SAMPLERS) - nve4_compute_validate_samplers(nvc0); - if (nvc0->dirty_cp & (NVC0_NEW_CP_TEXTURES | NVC0_NEW_CP_SAMPLERS)) - nve4_compute_set_tex_handles(nvc0); - if (nvc0->dirty_cp & NVC0_NEW_CP_SURFACES) - nve4_compute_validate_surfaces(nvc0); - if (nvc0->dirty_cp & NVC0_NEW_CP_GLOBALS) - nvc0_compute_validate_globals(nvc0); - - nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, false); - - nouveau_pushbuf_bufctx(nvc0->base.pushbuf, nvc0->bufctx_cp); - if (unlikely(nouveau_pushbuf_validate(nvc0->base.pushbuf))) - return false; - if (unlikely(nvc0->state.flushed_cp)) { - nvc0->state.flushed_cp = false; - nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, true); - } - - return true; + return nvc0_state_validate(nvc0, mask, validate_list_cp, + ARRAY_SIZE(validate_list_cp),
[Mesa-dev] [PATCH] nvc0/ir: add ld lock/st unlock emission on GK104
Signed-off-by: Samuel Pitoiset --- .../drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 35 +++--- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp index 7042246..8e6dfad 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp @@ -1781,11 +1781,14 @@ CodeEmitterNVC0::emitSTORE(const Instruction *i) case FILE_MEMORY_GLOBAL: opc = 0x9000; break; case FILE_MEMORY_LOCAL: opc = 0xc800; break; case FILE_MEMORY_SHARED: - opc = 0xc800; - if (i->subOp == NV50_IR_SUBOP_STORE_UNLOCKED) - opc |= (1 << 26); - else - opc |= (1 << 24); + if (i->subOp == NV50_IR_SUBOP_STORE_UNLOCKED) { + if (targ->getChipset() >= NVISA_GK104_CHIPSET) +opc = 0xb800; + else +opc = 0xcc00; + } else { + opc = 0xc900; + } break; default: assert(!"invalid memory file"); @@ -1795,6 +1798,15 @@ CodeEmitterNVC0::emitSTORE(const Instruction *i) code[0] = 0x0005; code[1] = opc; + if (targ->getChipset() >= NVISA_GK104_CHIPSET) { + // Unlocked store on shared memory can fail. + if (i->src(0).getFile() == FILE_MEMORY_SHARED && + i->subOp == NV50_IR_SUBOP_STORE_UNLOCKED) { + assert(i->defExists(0)); + defId(i->def(0), 8); + } + } + setAddressByFile(i->src(0)); srcId(i->src(1), 14); srcId(i->src(0).getIndirect(0), 20); @@ -1818,11 +1830,14 @@ CodeEmitterNVC0::emitLOAD(const Instruction *i) case FILE_MEMORY_GLOBAL: opc = 0x8000; break; case FILE_MEMORY_LOCAL: opc = 0xc000; break; case FILE_MEMORY_SHARED: - opc = 0xc000; - if (i->subOp == NV50_IR_SUBOP_LOAD_LOCKED) - opc |= (1 << 26); - else - opc |= (1 << 24); + if (i->subOp == NV50_IR_SUBOP_LOAD_LOCKED) { + if (targ->getChipset() >= NVISA_GK104_CHIPSET) +opc = 0xa800; + else +opc = 0xc400; + } else { + opc = 0xc100; + } break; case FILE_MEMORY_CONST: if (!i->src(0).isIndirect(0) && typeSizeof(i->dType) == 4) { -- 2.6.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: add GL_OES_shader_multisample_interpolation support
On Sat, Feb 20, 2016 at 9:05 PM, Ilia Mirkin wrote: > Signed-off-by: Ilia Mirkin > --- > > dEQP tests mostly pass... they reveal some pre-existing issues with packed > varyings and interpolateAt* - the interpolants become temporaries, which > breaks > everything. However fixing this should be unrelated to enabling this > extension. Piglit reveals this too if you don't compile shaders on demand. Marek ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/6] nvc0: rename nvc0_graph_state::flushed to ::flushed_3d
Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c| 2 +- src/gallium/drivers/nouveau/nvc0/nvc0_context.c| 2 +- src/gallium/drivers/nouveau/nvc0/nvc0_screen.h | 2 +- src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c | 4 ++-- src/gallium/drivers/nouveau/nvc0/nve4_compute.c| 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index 491221e..0717583 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -281,7 +281,7 @@ nvc0_compute_state_validate(struct nvc0_context *nvc0) nouveau_pushbuf_bufctx(nvc0->base.pushbuf, nvc0->bufctx_cp); if (unlikely(nouveau_pushbuf_validate(nvc0->base.pushbuf))) return false; - if (unlikely(nvc0->state.flushed)) + if (unlikely(nvc0->state.flushed_3d)) nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, true); return true; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c index f33d29d..683fc20 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c @@ -177,7 +177,7 @@ nvc0_default_kick_notify(struct nouveau_pushbuf *push) nouveau_fence_next(&screen->base); nouveau_fence_update(&screen->base, true); if (screen->cur_ctx) - screen->cur_ctx->state.flushed = true; + screen->cur_ctx->state.flushed_3d = true; NOUVEAU_DRV_STAT(&screen->base, pushbuf_count, 1); } } diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h index 8487abc..9a58da5 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h @@ -30,7 +30,7 @@ struct nvc0_context; struct nvc0_blitter; struct nvc0_graph_state { - bool flushed; + bool flushed_3d; bool rasterizer_discard; bool early_z_forced; bool prim_restart; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c index fbf45ce..e9a4f7c 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c @@ -740,8 +740,8 @@ nvc0_state_validate(struct nvc0_context *nvc0, uint32_t mask) nouveau_pushbuf_bufctx(nvc0->base.pushbuf, nvc0->bufctx_3d); ret = nouveau_pushbuf_validate(nvc0->base.pushbuf); - if (unlikely(nvc0->state.flushed)) { - nvc0->state.flushed = false; + if (unlikely(nvc0->state.flushed_3d)) { + nvc0->state.flushed_3d = false; nvc0_bufctx_fence(nvc0, nvc0->bufctx_3d, true); } return !ret; diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c index 60a7118..e33458b 100644 --- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c @@ -338,7 +338,7 @@ nve4_compute_state_validate(struct nvc0_context *nvc0) nouveau_pushbuf_bufctx(nvc0->base.pushbuf, nvc0->bufctx_cp); if (unlikely(nouveau_pushbuf_validate(nvc0->base.pushbuf))) return false; - if (unlikely(nvc0->state.flushed)) + if (unlikely(nvc0->state.flushed_3d)) nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, true); return true; -- 2.6.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/6] nvc0: rework nvc0_compute_validate_program()
Reduce the amount of duplicated code by re-using nvc0_program_validate(). While we are at it, change the prototype to return void. Signed-off-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c| 32 ++ src/gallium/drivers/nouveau/nvc0/nvc0_compute.h| 4 +-- src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 1 + .../drivers/nouveau/nvc0/nvc0_shader_state.c | 2 +- src/gallium/drivers/nouveau/nvc0/nve4_compute.c| 3 +- 5 files changed, 13 insertions(+), 29 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index 0f1265f..491221e 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -120,32 +120,17 @@ nvc0_screen_compute_setup(struct nvc0_screen *screen, return 0; } -bool +void nvc0_compute_validate_program(struct nvc0_context *nvc0) { - struct nvc0_program *prog = nvc0->compprog; - - if (prog->mem) - return true; + struct nouveau_pushbuf *push = nvc0->base.pushbuf; + struct nvc0_program *cp = nvc0->compprog; - if (!prog->translated) { - prog->translated = nvc0_program_translate( - prog, nvc0->screen->base.device->chipset, &nvc0->base.debug); - if (!prog->translated) - return false; - } - if (unlikely(!prog->code_size)) - return false; + if (cp && !nvc0_program_validate(nvc0, cp)) + return; - if (likely(prog->code_size)) { - if (nvc0_program_upload_code(nvc0, prog)) { - struct nouveau_pushbuf *push = nvc0->base.pushbuf; - BEGIN_NVC0(push, NVC0_CP(FLUSH), 1); - PUSH_DATA (push, NVC0_COMPUTE_FLUSH_CODE); - return true; - } - } - return false; + BEGIN_NVC0(push, NVC0_CP(FLUSH), 1); + PUSH_DATA (push, NVC0_COMPUTE_FLUSH_CODE); } static void @@ -277,8 +262,7 @@ nvc0_compute_validate_buffers(struct nvc0_context *nvc0) static bool nvc0_compute_state_validate(struct nvc0_context *nvc0) { - if (!nvc0_compute_validate_program(nvc0)) - return false; + nvc0_compute_validate_program(nvc0); if (nvc0->dirty_cp & NVC0_NEW_CP_CONSTBUF) nvc0_compute_validate_constbufs(nvc0); if (nvc0->dirty_cp & NVC0_NEW_CP_DRIVERCONST) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.h b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.h index a23f7f3..19cc15a 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.h @@ -3,7 +3,7 @@ #include "nvc0/nvc0_compute.xml.h" -bool -nvc0_compute_validate_program(struct nvc0_context *nvc0); +void +nvc0_compute_validate_program(struct nvc0_context *); #endif /* NVC0_COMPUTE_H */ diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h index 0bbbff5..542d644 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h @@ -249,6 +249,7 @@ uint32_t nvc0_program_symbol_offset(const struct nvc0_program *, void nvc0_program_init_tcp_empty(struct nvc0_context *); /* nvc0_shader_state.c */ +bool nvc0_program_validate(struct nvc0_context *, struct nvc0_program *); void nvc0_vertprog_validate(struct nvc0_context *); void nvc0_tctlprog_validate(struct nvc0_context *); void nvc0_tevlprog_validate(struct nvc0_context *); diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c index 2f46c43..4def04f 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c @@ -64,7 +64,7 @@ nvc0_program_update_context_state(struct nvc0_context *nvc0, } } -static inline bool +bool nvc0_program_validate(struct nvc0_context *nvc0, struct nvc0_program *prog) { if (prog->mem) diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c index 0ffcfb1..60a7118 100644 --- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c @@ -321,8 +321,7 @@ nvc0_compute_validate_globals(struct nvc0_context *nvc0) static bool nve4_compute_state_validate(struct nvc0_context *nvc0) { - if (!nvc0_compute_validate_program(nvc0)) - return false; + nvc0_compute_validate_program(nvc0); if (nvc0->dirty_cp & NVC0_NEW_CP_TEXTURES) nve4_compute_validate_textures(nvc0); if (nvc0->dirty_cp & NVC0_NEW_CP_SAMPLERS) -- 2.6.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 0/5] nvc0: comestic changes for 3D/COMPUTE
Hi there, This series only contains cosmetic changes to improve consistency between 3D and COMPUTE pipelines. Please review. Thanks! Samuel Pitoiset (5): nvc0: rename nvc0_context::dirty to nvc0_context::dirty_3d nvc0: rename NVXX_COMPUTE to NVXX_CP nvc0: prefix compute macros with _CP_ instead of _COMPUTE_ nvc0: rename 3d dirty flags to NVC0_NEW_3D_XXX nvc0: rename 3d binding points to NVC0_BIND_3D_XXX src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme | 2 +- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c| 102 ++-- src/gallium/drivers/nouveau/nvc0/nvc0_context.c| 42 - src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 84 - src/gallium/drivers/nouveau/nvc0/nvc0_macros.h | 2 +- .../drivers/nouveau/nvc0/nvc0_query_hw_sm.c| 28 +++--- src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 2 +- .../drivers/nouveau/nvc0/nvc0_shader_state.c | 12 +-- src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 74 +++ .../drivers/nouveau/nvc0/nvc0_state_validate.c | 104 ++--- src/gallium/drivers/nouveau/nvc0/nvc0_surface.c| 53 +-- src/gallium/drivers/nouveau/nvc0/nvc0_tex.c| 10 +- src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c| 22 ++--- .../drivers/nouveau/nvc0/nvc0_vbo_translate.c | 6 +- src/gallium/drivers/nouveau/nvc0/nvc0_winsys.h | 6 +- src/gallium/drivers/nouveau/nvc0/nve4_compute.c| 98 +-- 16 files changed, 324 insertions(+), 323 deletions(-) -- 2.6.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] abundance of branches in mesa.git
On Sat, Feb 20, 2016 at 2:41 PM, Jason Ekstrand wrote: > > On Feb 20, 2016 1:19 PM, "Rob Clark" wrote: > > > > fwiw, I think a *small* number of topic branches in certain cases > > makes sense.. I'm definitely in support of a TTL limit (ie. > > automatically nuke topic branches with no activity in N months, or > > similar..) > > I agree. Sometimes something big comes up that's not ready for merging > such as amdgpu or our recently pushed Vulkan driver. However, those should > only be temporary and removed once the work is complete. I saw a > "broadwell" branch in there which is probably at least 2 years old and > completely subsumed by master. We don't want to be archiving random junk > in the main tree. > > I'd be fine with a timeout system where non-release branches get the boot > after a certain amount inactivity. If you want to archive something, that's > what personal git repos are for. > I'm OK with deleting old branches too. I don't know much about git under the hood- would deleting old branches actually delete the objects on those branches and make the database smaller? If so, I'm guessing it probably wouldn't amount to much. -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] abundance of branches in mesa.git
On Sat, Feb 20, 2016 at 4:41 PM, Jason Ekstrand wrote: > On Feb 20, 2016 1:19 PM, "Rob Clark" wrote: >> >> fwiw, I think a *small* number of topic branches in certain cases >> makes sense.. I'm definitely in support of a TTL limit (ie. >> automatically nuke topic branches with no activity in N months, or >> similar..) > > I agree. Sometimes something big comes up that's not ready for merging such > as amdgpu or our recently pushed Vulkan driver. However, those should only > be temporary and removed once the work is complete. I saw a "broadwell" > branch in there which is probably at least 2 years old and completely > subsumed by master. We don't want to be archiving random junk in the main > tree. > > I'd be fine with a timeout system where non-release branches get the boot > after a certain amount inactivity. If you want to archive something, that's > what personal git repos are for. fwiw, I would totally ack a plan to automatically delete inactive topic branches after N months of inactivity (where I'd be fine with N==2 or even as high as N==12 but I think you'd have a hard time convincing me for N>12) Bonus points if someone wanted to archive old branches somewhere.. but I don't care strongly about that.. BR, -R ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] abundance of branches in mesa.git
On Sat, Feb 20, 2016 at 5:36 PM, Rob Clark wrote: > On Sat, Feb 20, 2016 at 4:41 PM, Jason Ekstrand > wrote: > > On Feb 20, 2016 1:19 PM, "Rob Clark" wrote: > >> > >> fwiw, I think a *small* number of topic branches in certain cases > >> makes sense.. I'm definitely in support of a TTL limit (ie. > >> automatically nuke topic branches with no activity in N months, or > >> similar..) > > > > I agree. Sometimes something big comes up that's not ready for merging > such > > as amdgpu or our recently pushed Vulkan driver. However, those should > only > > be temporary and removed once the work is complete. I saw a "broadwell" > > branch in there which is probably at least 2 years old and completely > > subsumed by master. We don't want to be archiving random junk in the > main > > tree. > > > > I'd be fine with a timeout system where non-release branches get the boot > > after a certain amount inactivity. If you want to archive something, > that's > > what personal git repos are for. > > fwiw, I would totally ack a plan to automatically delete inactive > topic branches after N months of inactivity (where I'd be fine with > N==2 or even as high as N==12 but I think you'd have a hard time > convincing me for N>12) > > Bonus points if someone wanted to archive old branches somewhere.. but > I don't care strongly about that.. > Chad has some nifty way of archiving branches where they still exist and have names but are hidden. I don't remember how it works though. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev