From patchwork Tue Mar 21 05:00:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Gray X-Patchwork-Id: 9636003 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B7C006020B for ; Tue, 21 Mar 2017 05:00:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A80311FE84 for ; Tue, 21 Mar 2017 05:00:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CA18279E0; Tue, 21 Mar 2017 05:00:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AD3851FE84 for ; Tue, 21 Mar 2017 05:00:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 618DF6E04C; Tue, 21 Mar 2017 05:00:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lechuck.jsg.id.au (jsg.id.au [210.15.216.215]) by gabe.freedesktop.org (Postfix) with ESMTPS id B32A46E00D; Tue, 21 Mar 2017 05:00:39 +0000 (UTC) Received: from largo.jsg.id.au (largo.jsg.id.au [192.168.1.43]) by lechuck.jsg.id.au (OpenSMTPD) with ESMTP id 6bce1d58; Tue, 21 Mar 2017 16:00:37 +1100 (AEDT) Received: from localhost (largo.jsg.id.au [local]) by largo.jsg.id.au (OpenSMTPD) with ESMTPA id 79e91c2d; Tue, 21 Mar 2017 16:00:37 +1100 (AEDT) Date: Tue, 21 Mar 2017 16:00:37 +1100 From: Jonathan Gray To: Timothy Arceri Subject: Re: [Mesa-dev] [RFC libdrm 0/2] Replace the build system with meson Message-ID: <20170321050037.GH651@largo.jsg.id.au> References: <148971007574.15211.14603838222614916328@localhost.localdomain> <15ada012eb8.277a.c6988b7ea6112e3e892765a0d4287e0c@jlekstrand.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.2 (2016-07-01) Cc: ML mesa-dev , Emil Velikov , ML dri-devel X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Mar 21, 2017 at 08:28:22AM +1100, Timothy Arceri wrote: > > > On 21/03/17 06:39, Emil Velikov wrote: > > On 20 March 2017 at 18:30, Matt Turner wrote: > > > On Mon, Mar 20, 2017 at 6:55 AM, Emil Velikov wrote: > > > > Seems like we ended up all over the place, so let me try afresh. > > > > > > > > Above all: > > > > - Saying "I don't care" about your users is arrogant - let us _not_ > > > > do that, please ? > > > > > > Let's be honest, the OpenBSD is subjecting itself to some pretty > > > arbitrary restrictions caused including Mesa in its core: 10+ year old > > > GCC, > > IIRC Brian was using old MinGW GCC, which was one of the blockers - it > > wasn't OpenBSD to blame here ;-) > > Sorry Emil I probably wasn't clear in our discussion. I sent out patches to > switch to GCC 4.8 last Sept (I believe this was needed by RHEL6) [1]. > > Brain jumped in and said "I'm still using the MinGW gcc 4.6 compiler. I'd > rather not go through the upgrade hassle if I don't have to." > > Followed by Jose "We're internally building and shipping Mesa compiled with > GCC 4.4 (more specifically 4.4.3). > > It's fine if you require GCC 4.8 on automake, but please leave support > for GCC 4.4.x in SCons." > > By this point I got bored and moved on. But OpenBSDs GCC is a fork with > various features backported, from what I understand Mesa would not build on > a real GCC 4.2 release and we should not be using it as a min version. IMO > if OpenBSD want to maintain a GCC fork they can handle a patch to downgrade > the min GCC version. > > I believe Jonathan would like us to stick with 4.2 as min but is prepared to > deal with it if we move on. I would like to see Mesa test features it uses in configure rather than arbitary versions that are what a certain linux distribution ships with. The zlib change for instance didn't reference any specific problems with older versions or interfaces required from newer versions. We have one platform using clang/lld now (arm64) and are likely to move others in future where possible. libtool has to be patched and the Mesa configure script regenerated to make this work or Mesa won't build due to libtool.m4 looking for specific strings in ld -v produced by bfd binutils or gold... And yes if you change the configure script to check for a newer version I'll revert it locally like I did with the zlib one. As I get the impression no one cares about patches for older GCC I've not being sending them to the list, ie commit d3d340d6026e516cc405a2eb1d925a7a7a467480 Author: Jonathan Gray Date: Thu Mar 16 00:30:07 2017 +1100 i965: don't use designated array initialisation Don't use a form of designated array initialisation that breaks gcc 4.2.1. compiler/brw_vec4_gs_visitor.cpp:589: error: expected primary-expression before '[' token compiler/brw_vec4_gs_visitor.cpp:590: error: expected primary-expression before '[' token compiler/brw_vec4_gs_visitor.cpp:591: error: expected primary-expression before '[' token compiler/brw_vec4_gs_visitor.cpp:592: error: expected primary-expression before '[' token compiler/brw_vec4_gs_visitor.cpp:593: error: expected primary-expression before '[' token compiler/brw_vec4_gs_visitor.cpp:594: error: expected primary-expression before '[' token compiler/brw_vec4_gs_visitor.cpp:595: error: expected primary-expression before '[' token compiler/brw_vec4_gs_visitor.cpp:596: error: expected primary-expression before '[' token compiler/brw_vec4_gs_visitor.cpp:597: error: expected primary-expression before '[' token compiler/brw_vec4_gs_visitor.cpp:598: error: expected primary-expression before '[' token compiler/brw_vec4_gs_visitor.cpp:599: error: expected primary-expression before '[' token compiler/brw_vec4_gs_visitor.cpp:600: error: expected primary-expression before '[' token compiler/brw_vec4_gs_visitor.cpp:601: error: expected primary-expression before '[' token compiler/brw_vec4_gs_visitor.cpp:602: error: expected primary-expression before '[' token Signed-off-by: Jonathan Gray diff --git a/src/intel/compiler/brw_vec4_gs_visitor.cpp b/src/intel/compiler/brw_vec4_gs_visitor.cpp index 4a8b5be30e..e7a502306e 100644 --- a/src/intel/compiler/brw_vec4_gs_visitor.cpp +++ b/src/intel/compiler/brw_vec4_gs_visitor.cpp @@ -585,23 +585,6 @@ vec4_gs_visitor::gs_end_primitive() emit(OR(dst_reg(this->control_data_bits), this->control_data_bits, mask)); } -static const GLuint gl_prim_to_hw_prim[GL_TRIANGLE_STRIP_ADJACENCY+1] = { - [GL_POINTS] =_3DPRIM_POINTLIST, - [GL_LINES] = _3DPRIM_LINELIST, - [GL_LINE_LOOP] = _3DPRIM_LINELOOP, - [GL_LINE_STRIP] = _3DPRIM_LINESTRIP, - [GL_TRIANGLES] = _3DPRIM_TRILIST, - [GL_TRIANGLE_STRIP] = _3DPRIM_TRISTRIP, - [GL_TRIANGLE_FAN] = _3DPRIM_TRIFAN, - [GL_QUADS] = _3DPRIM_QUADLIST, - [GL_QUAD_STRIP] = _3DPRIM_QUADSTRIP, - [GL_POLYGON] = _3DPRIM_POLYGON, - [GL_LINES_ADJACENCY] = _3DPRIM_LINELIST_ADJ, - [GL_LINE_STRIP_ADJACENCY] = _3DPRIM_LINESTRIP_ADJ, - [GL_TRIANGLES_ADJACENCY] = _3DPRIM_TRILIST_ADJ, - [GL_TRIANGLE_STRIP_ADJACENCY] = _3DPRIM_TRISTRIP_ADJ, -}; - extern "C" const unsigned * brw_compile_gs(const struct brw_compiler *compiler, void *log_data, void *mem_ctx, @@ -814,9 +797,51 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data, else prog_data->base.urb_entry_size = ALIGN(output_size_bytes, 128) / 128; - assert(shader->info->gs.output_primitive < ARRAY_SIZE(gl_prim_to_hw_prim)); - prog_data->output_topology = - gl_prim_to_hw_prim[shader->info->gs.output_primitive]; + assert(shader->info->gs.output_primitive < (GL_TRIANGLE_STRIP_ADJACENCY+1)); + switch (shader->info->gs.output_primitive) { + case GL_POINTS: + prog_data->output_topology =_3DPRIM_POINTLIST; + break; + case GL_LINES: + prog_data->output_topology = _3DPRIM_LINELIST; + break; + case GL_LINE_LOOP: + prog_data->output_topology = _3DPRIM_LINELOOP; + break; + case GL_LINE_STRIP: + prog_data->output_topology = _3DPRIM_LINESTRIP; + break; + case GL_TRIANGLES: + prog_data->output_topology = _3DPRIM_TRILIST; + break; + case GL_TRIANGLE_STRIP: + prog_data->output_topology = _3DPRIM_TRISTRIP; + break; + case GL_TRIANGLE_FAN: + prog_data->output_topology = _3DPRIM_TRIFAN; + break; + case GL_QUADS: + prog_data->output_topology = _3DPRIM_QUADLIST; + break; + case GL_QUAD_STRIP: + prog_data->output_topology = _3DPRIM_QUADSTRIP; + break; + case GL_POLYGON: + prog_data->output_topology = _3DPRIM_POLYGON; + break; + case GL_LINES_ADJACENCY: + prog_data->output_topology = _3DPRIM_LINELIST_ADJ; + break; + case GL_LINE_STRIP_ADJACENCY: + prog_data->output_topology = _3DPRIM_LINESTRIP_ADJ; + break; + case GL_TRIANGLES_ADJACENCY: + prog_data->output_topology = _3DPRIM_TRILIST_ADJ; + break; + case GL_TRIANGLE_STRIP_ADJACENCY: + prog_data->output_topology = _3DPRIM_TRISTRIP_ADJ; + break; + } prog_data->vertices_in = shader->info->gs.vertices_in;