[Mesa-dev] [PATCH] anv: Drop unnecessary is_haswell check in state base address code.

Matt Turner mattst88 at gmail.com
Mon Jul 18 21:00:20 UTC 2016


On Mon, Jul 18, 2016 at 1:41 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> Both branches are identical.  Fixes a Coverity warning.
>
> CID: 1364155
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/intel/vulkan/anv_cmd_buffer.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c
> index 6256df8..ce4266f 100644
> --- a/src/intel/vulkan/anv_cmd_buffer.c
> +++ b/src/intel/vulkan/anv_cmd_buffer.c
> @@ -358,10 +358,7 @@ anv_cmd_buffer_emit_state_base_address(struct anv_cmd_buffer *cmd_buffer)
>  {
>     switch (cmd_buffer->device->info.gen) {
>     case 7:
> -      if (cmd_buffer->device->info.is_haswell)
> -         return gen7_cmd_buffer_emit_state_base_address(cmd_buffer);
> -      else
> -         return gen7_cmd_buffer_emit_state_base_address(cmd_buffer);
> +      return gen7_cmd_buffer_emit_state_base_address(cmd_buffer);
>     case 8:
>        return gen8_cmd_buffer_emit_state_base_address(cmd_buffer);
>     case 9:
> --
> 2.9.0

This was added in commit 6f613abc2b, which looks really sketchy.

The patch adds a prototype for
gen75_cmd_buffer_emit_state_base_address(), which I assume was
intended to be used in this if-statement, and the commit summary says
"Incidentally, this should fix MOCS settings for dynamic and surface
state on Haswell." but other than the useless is_haswell check your
patch removes it didn't touch anything related to Haswell.

Jason should really take a look. Clearly /something/ is wrong.


More information about the mesa-dev mailing list