[Mesa-dev] [PATCH mesa] freedreno: gallium driver for adreno

Rob Clark robdclark at gmail.com
Mon Feb 18 10:58:16 PST 2013


On Mon, Feb 18, 2013 at 12:47 PM, Matt Turner <mattst88 at gmail.com> wrote:
> On Sun, Feb 17, 2013 at 11:33 AM, Rob Clark <robdclark at gmail.com> wrote:
>>
>> diff --git a/src/gallium/drivers/freedreno/Makefile.am b/src/gallium/drivers/freedreno/Makefile.am
>> new file mode 100644
>> index 0000000..10abdfb
>> --- /dev/null
>> +++ b/src/gallium/drivers/freedreno/Makefile.am
>> @@ -0,0 +1,35 @@
>> +include $(top_srcdir)/src/gallium/Automake.inc
>> +
>> +noinst_LTLIBRARIES = libfreedreno.la
>> +
>> +AM_CFLAGS = \
>> +       -Werror -Wno-packed-bitfield-compat \
>> +       -I$(top_srcdir)/src/gallium/include \ <--
>> +       -I$(top_srcdir)/src/gallium/auxiliary \ <--
>> +       -I$(top_srcdir)/src/gallium/drivers \
>> +       -I$(top_srcdir)/include \ <--
>> +       $(FREEDRENO_CFLAGS) \
>> +       $(DEFINES) \ <--
>> +       $(PIC_FLAGS) \
>> +       $(VISIBILITY_CFLAGS)
>
> The <-- mark things that are provided by the GALLIUM_CFLAGS variable
> in Automake.inc that you've already included. PIC_FLAGS is now dead.
> Distributions don't like -Werror being hardcoded into upstream's
> CFLAGS.

Hmm, is there a better way to get -Werror for just freedreno when I am
building myself?  I do find that it is pretty useful to let the
compiler help me catch problems rather than debugging them the hard
way ;-)


>> diff --git a/src/gallium/drivers/freedreno/a2xx_reg.h b/src/gallium/drivers/freedreno/a2xx_reg.h
>> new file mode 100644
>> index 0000000..27403ec
>> --- /dev/null
>> +++ b/src/gallium/drivers/freedreno/a2xx_reg.h
>> @@ -0,0 +1,455 @@
>> +/* Copyright (c) 2002,2007-2012, Code Aurora Forum. All rights reserved.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 and
>> + * only version 2 as published by the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>
> GPL?

yeah, this and a couple other headers are coming from qcom kernel
driver, so it wouldn't be right for me to change the license.  I guess
I could just re-implement these headers myself.  But IANAL so wasn't
quite clear about what to do for these..


>> diff --git a/src/gallium/targets/dri-freedreno/Makefile.am b/src/gallium/targets/dri-freedreno/Makefile.am
>> new file mode 100644
>> index 0000000..59293a6
>> --- /dev/null
>> +++ b/src/gallium/targets/dri-freedreno/Makefile.am
>> @@ -0,0 +1,71 @@
>> +# Copyright © 2012 Intel Corporation
>> +#
>> +# Permission is hereby granted, free of charge, to any person obtaining a
>> +# copy of this software and associated documentation files (the "Software"),
>> +# to deal in the Software without restriction, including without limitation
>> +# the rights to use, copy, modify, merge, publish, distribute, sublicense,
>> +# and/or sell copies of the Software, and to permit persons to whom the
>> +# Software is furnished to do so, subject to the following conditions:
>> +#
>> +# The above copyright notice and this permission notice (including the next
>> +# paragraph) shall be included in all copies or substantial portions of the
>> +# Software.
>> +#
>> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>> +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
>> +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
>> +# NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
>> +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
>> +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
>> +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>> +# DEALINGS IN THE SOFTWARE.
>> +
>> +include $(top_srcdir)/src/gallium/Automake.inc
>> +
>> +AM_CFLAGS = \
>> +       $(GALLIUM_CFLAGS) \
>> +       $(PTHREAD_CFLAGS) \
>> +       $(LIBDRM_CFLAGS)
>> +AM_CPPFLAGS = \
>> +       -I$(top_srcdir)/src/gallium/drivers \
>> +       -I$(top_srcdir)/src/gallium/winsys \
>> +       -I$(top_srcdir)/src/mesa \
>> +       -I$(top_srcdir)/src/mapi \
>> +       -I$(top_builddir)/src/mesa/drivers/dri/common \
>> +       -DGALLIUM_RBUG \
>> +       -DGALLIUM_TRACE
>> +
>> +dridir = $(DRI_DRIVER_INSTALL_DIR)
>> +dri_LTLIBRARIES = kgsl_dri.la
>> +
>> +nodist_EXTRA_kgsl_dri_la_SOURCES = dummy.cpp
>> +kgsl_dri_la_SOURCES = \
>> +       target.c \
>> +       $(top_srcdir)/src/mesa/drivers/dri/common/utils.c \
>> +       $(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
>> +       $(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
>> +
>> +kgsl_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
>> +
>> +kgsl_dri_la_LIBADD = \
>> +       $(top_builddir)/src/mesa/libmesagallium.la \
>> +       $(top_builddir)/src/gallium/auxiliary/libgallium.la \
>> +       $(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
>> +       $(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
>> +       $(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
>> +       $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
>> +       $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
>> +       $(GALLIUM_DRI_LIB_DEPS) \
>> +       $(LIBDRM_LIBS) \
>> +       $(FREEDRENO_LIBS)
>> +
>> +if HAVE_MESA_LLVM
>> +kgsl_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
>> +kgsl_dri_la_LIBADD += $(LLVM_LIBS)
>> +endif
>
> Just want to confirm that LLVM is useful for Freedreno and that this
> wasn't just a copy-n-paste?

I don't use LLVM (directly) yet in freedreno..  maybe I will some day,
I haven't quite decided about the best route to take when I start
trying to make the compiler a bit more intelligent.  This was just
cut/paste (I think from nouveau), I wasn't sure if/why it was needed.


BR,
-R


More information about the mesa-dev mailing list