[PATCH 1/2] libdrm: add etnaviv drm support

2016-09-09 Thread Christian Gmeiner
Hi Rob,

2016-09-08 20:52 GMT+02:00 Rob Herring :
> On Thu, Sep 1, 2016 at 2:08 PM, Christian Gmeiner
>  wrote:
>> Hi Emil,
>>
>> thanks a lot for the review.
>>
>> 2016-08-30 15:03 GMT+02:00 Emil Velikov :
>>> On 30 August 2016 at 08:14, Christian Gmeiner
>>>  wrote:
 From: The etnaviv authors 

 Add the libdrm_etnaviv helper library to encapsulate etnaviv-specific 
 interfaces to the DRM.

 Signed-off-by: Christian Gmeiner 
 Signed-off-by: Lucas Stach 
>>> Just double-checking:
>>>  - you've looked that all the relevant freedreno patches have been
>>> ported over, correct ?
>>>  - the feature checking bug (mentioned on IRC) has been fixed ?
>>>
 diff --git a/configure.ac b/configure.ac
 index e3048c7..64f3e6c 100644
 --- a/configure.ac
 +++ b/configure.ac
>>>
 @@ -274,6 +279,9 @@ if test "x$drm_cv_atomic_primitives" = "xnone"; then

 LIBDRM_ATOMICS_NOT_FOUND_MSG($TEGRA, tegra, NVIDIA Tegra, 
 tegra-experimental-api)
 TEGRA=no
 +
 +   LIBDRM_ATOMICS_NOT_FOUND_MSG($ETNAVIV, etnaviv, Vivante, 
 etnaviv-experimental-api)
>>> Reading this hunk reminds me what a bad name I've used. Then again
>>> nothing better comes up atm. If you can think of any please shout.
>>>
 +++ b/etnaviv/Android.mk
>>> Have you tried building/using etna on Android ?
>>>
>>
>> No.. if it is an easy job I would give it a try. Shall I drop it?
>
> But I have. libdrm just needs this patch (for master and N):
>

Great!

> @@ -9,7 +9,7 @@ LOCAL_MODULE_TAGS := optional
>
>  LOCAL_SHARED_LIBRARIES := libdrm
>
> -LOCAL_SRC_FILES := $(LIBDRM_ETNAVIV_FILES)
> +LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_ETNAVIV_FILES))
>  LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
>
>  LOCAL_CFLAGS := \
>
>
> I've got mesa building on Android, too. It's a few patches so far of
> Android.mk additions and things that break with clang or post 12.0.
> The etnaviv branch also breaks other drivers with the max vertex
> buffer capability addition.
>

Yeah I am aware of that and I am currently working on a fix for that.

thanks
--
Christian Gmeiner, MSc

https://soundcloud.com/christian-gmeiner


[PATCH 1/2] libdrm: add etnaviv drm support

2016-09-08 Thread Rob Herring
On Thu, Sep 8, 2016 at 1:52 PM, Rob Herring  wrote:
> On Thu, Sep 1, 2016 at 2:08 PM, Christian Gmeiner
>  wrote:
>> Hi Emil,
>>
>> thanks a lot for the review.
>>
>> 2016-08-30 15:03 GMT+02:00 Emil Velikov :
>>> On 30 August 2016 at 08:14, Christian Gmeiner
>>>  wrote:
 From: The etnaviv authors 

 Add the libdrm_etnaviv helper library to encapsulate etnaviv-specific 
 interfaces to the DRM.

 Signed-off-by: Christian Gmeiner 
 Signed-off-by: Lucas Stach 
>>> Just double-checking:
>>>  - you've looked that all the relevant freedreno patches have been
>>> ported over, correct ?
>>>  - the feature checking bug (mentioned on IRC) has been fixed ?
>>>
 diff --git a/configure.ac b/configure.ac
 index e3048c7..64f3e6c 100644
 --- a/configure.ac
 +++ b/configure.ac
>>>
 @@ -274,6 +279,9 @@ if test "x$drm_cv_atomic_primitives" = "xnone"; then

 LIBDRM_ATOMICS_NOT_FOUND_MSG($TEGRA, tegra, NVIDIA Tegra, 
 tegra-experimental-api)
 TEGRA=no
 +
 +   LIBDRM_ATOMICS_NOT_FOUND_MSG($ETNAVIV, etnaviv, Vivante, 
 etnaviv-experimental-api)
>>> Reading this hunk reminds me what a bad name I've used. Then again
>>> nothing better comes up atm. If you can think of any please shout.
>>>
 +++ b/etnaviv/Android.mk
>>> Have you tried building/using etna on Android ?
>>>
>>
>> No.. if it is an easy job I would give it a try. Shall I drop it?
>
> But I have. libdrm just needs this patch (for master and N):

NM. I see you already have that change in this patch, so Android build
should be fine. I'll give v2 patch a try.

Rob


[PATCH 1/2] libdrm: add etnaviv drm support

2016-09-08 Thread Rob Herring
On Thu, Sep 1, 2016 at 2:08 PM, Christian Gmeiner
 wrote:
> Hi Emil,
>
> thanks a lot for the review.
>
> 2016-08-30 15:03 GMT+02:00 Emil Velikov :
>> On 30 August 2016 at 08:14, Christian Gmeiner
>>  wrote:
>>> From: The etnaviv authors 
>>>
>>> Add the libdrm_etnaviv helper library to encapsulate etnaviv-specific 
>>> interfaces to the DRM.
>>>
>>> Signed-off-by: Christian Gmeiner 
>>> Signed-off-by: Lucas Stach 
>> Just double-checking:
>>  - you've looked that all the relevant freedreno patches have been
>> ported over, correct ?
>>  - the feature checking bug (mentioned on IRC) has been fixed ?
>>
>>> diff --git a/configure.ac b/configure.ac
>>> index e3048c7..64f3e6c 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>
>>> @@ -274,6 +279,9 @@ if test "x$drm_cv_atomic_primitives" = "xnone"; then
>>>
>>> LIBDRM_ATOMICS_NOT_FOUND_MSG($TEGRA, tegra, NVIDIA Tegra, 
>>> tegra-experimental-api)
>>> TEGRA=no
>>> +
>>> +   LIBDRM_ATOMICS_NOT_FOUND_MSG($ETNAVIV, etnaviv, Vivante, 
>>> etnaviv-experimental-api)
>> Reading this hunk reminds me what a bad name I've used. Then again
>> nothing better comes up atm. If you can think of any please shout.
>>
>>> +++ b/etnaviv/Android.mk
>> Have you tried building/using etna on Android ?
>>
>
> No.. if it is an easy job I would give it a try. Shall I drop it?

But I have. libdrm just needs this patch (for master and N):

@@ -9,7 +9,7 @@ LOCAL_MODULE_TAGS := optional

 LOCAL_SHARED_LIBRARIES := libdrm

-LOCAL_SRC_FILES := $(LIBDRM_ETNAVIV_FILES)
+LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_ETNAVIV_FILES))
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)

 LOCAL_CFLAGS := \


I've got mesa building on Android, too. It's a few patches so far of
Android.mk additions and things that break with clang or post 12.0.
The etnaviv branch also breaks other drivers with the max vertex
buffer capability addition.

Rob


[PATCH 1/2] libdrm: add etnaviv drm support

2016-09-02 Thread Emil Velikov
On 1 September 2016 at 20:08, Christian Gmeiner
 wrote:
> Hi Emil,
>
> thanks a lot for the review.
>
> 2016-08-30 15:03 GMT+02:00 Emil Velikov :
>> On 30 August 2016 at 08:14, Christian Gmeiner
>>  wrote:
>>> From: The etnaviv authors 
>>>
>>> Add the libdrm_etnaviv helper library to encapsulate etnaviv-specific 
>>> interfaces to the DRM.
>>>
>>> Signed-off-by: Christian Gmeiner 
>>> Signed-off-by: Lucas Stach 
>> Just double-checking:
>>  - you've looked that all the relevant freedreno patches have been
>> ported over, correct ?
>>  - the feature checking bug (mentioned on IRC) has been fixed ?
>>
>>> diff --git a/configure.ac b/configure.ac
>>> index e3048c7..64f3e6c 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>
>>> @@ -274,6 +279,9 @@ if test "x$drm_cv_atomic_primitives" = "xnone"; then
>>>
>>> LIBDRM_ATOMICS_NOT_FOUND_MSG($TEGRA, tegra, NVIDIA Tegra, 
>>> tegra-experimental-api)
>>> TEGRA=no
>>> +
>>> +   LIBDRM_ATOMICS_NOT_FOUND_MSG($ETNAVIV, etnaviv, Vivante, 
>>> etnaviv-experimental-api)
>> Reading this hunk reminds me what a bad name I've used. Then again
>> nothing better comes up atm. If you can think of any please shout.
>>
>>> +++ b/etnaviv/Android.mk
>> Have you tried building/using etna on Android ?
>>
>
> No.. if it is an easy job I would give it a try. Shall I drop it?
>
Mostly curious. It doesn't get in the way so I'd keep it as-is.

Everything but the "NB use make headers_install for etnaviv_drm.h" is
just polish. So if that's OK you can address any/all of the remainder
as small follow up patches on top. It's up-to you really.

Since you're likely giving mesa side a final polish before sending,
please point out where the latest work can be found in the interim.

Thanks
Emil


[PATCH 1/2] libdrm: add etnaviv drm support

2016-09-01 Thread Christian Gmeiner
Hi Emil,

thanks a lot for the review.

2016-08-30 15:03 GMT+02:00 Emil Velikov :
> On 30 August 2016 at 08:14, Christian Gmeiner
>  wrote:
>> From: The etnaviv authors 
>>
>> Add the libdrm_etnaviv helper library to encapsulate etnaviv-specific 
>> interfaces to the DRM.
>>
>> Signed-off-by: Christian Gmeiner 
>> Signed-off-by: Lucas Stach 
> Just double-checking:
>  - you've looked that all the relevant freedreno patches have been
> ported over, correct ?
>  - the feature checking bug (mentioned on IRC) has been fixed ?
>
>> diff --git a/configure.ac b/configure.ac
>> index e3048c7..64f3e6c 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>
>> @@ -274,6 +279,9 @@ if test "x$drm_cv_atomic_primitives" = "xnone"; then
>>
>> LIBDRM_ATOMICS_NOT_FOUND_MSG($TEGRA, tegra, NVIDIA Tegra, 
>> tegra-experimental-api)
>> TEGRA=no
>> +
>> +   LIBDRM_ATOMICS_NOT_FOUND_MSG($ETNAVIV, etnaviv, Vivante, 
>> etnaviv-experimental-api)
> Reading this hunk reminds me what a bad name I've used. Then again
> nothing better comes up atm. If you can think of any please shout.
>
>> +++ b/etnaviv/Android.mk
> Have you tried building/using etna on Android ?
>

No.. if it is an easy job I would give it a try. Shall I drop it?

>
>> +++ b/etnaviv/Makefile.am
>> @@ -0,0 +1,27 @@
>> +AUTOMAKE_OPTIONS=subdir-objects
> There are no subdirectories so you don't need this. Then again, can we
> move the freedreno one to configure.ac - just append to
> AM_INIT_AUTOMAKE.
>

Okay

>> +include Makefile.sources
>> +
>> +AM_CFLAGS = \
>> +   $(WARN_CFLAGS) \
>> +   -I$(top_srcdir) \
>> +   $(PTHREADSTUBS_CFLAGS) \
>> +   -I$(top_srcdir)/include/drm
>> +
>> +libdrm_etnaviv_ladir = $(libdir)
>> +libdrm_etnaviv_la_LTLIBRARIES = libdrm_etnaviv.la
>> +libdrm_etnaviv_la_LDFLAGS = -version-number 0:0:0 -no-undefined
> Maybe make this 1:0:0 ?
>

Sure.. why not.

>> --- /dev/null
>> +++ b/etnaviv/etnaviv-symbol-check
>> @@ -0,0 +1,45 @@
>> +#!/bin/bash
>> +
>> +# The following symbols (past the first five) are taken from the public 
>> headers.
>> +# A list of the latter should be available 
>> Makefile.sources/LIBDRM_FREEDRENO_H_FILES
>> +
> LIBDRM_ETNAVIV_H_FILES?
>

Opps... good catch. Will fix it in v2.

>
>> new file mode 100644
>> index 000..462241c
>> --- /dev/null
>> +++ b/etnaviv/etnaviv_drm.h
> Double-checking: this file is identical to the one produced by make
> headers_install, correct ?
>

I need to check that - if something is wrong it will be fixed in v2.

greets
--
Christian Gmeiner, MSc

https://soundcloud.com/christian-gmeiner


[PATCH 1/2] libdrm: add etnaviv drm support

2016-08-30 Thread Emil Velikov
On 30 August 2016 at 08:14, Christian Gmeiner
 wrote:
> From: The etnaviv authors 
>
> Add the libdrm_etnaviv helper library to encapsulate etnaviv-specific 
> interfaces to the DRM.
>
> Signed-off-by: Christian Gmeiner 
> Signed-off-by: Lucas Stach 
Just double-checking:
 - you've looked that all the relevant freedreno patches have been
ported over, correct ?
 - the feature checking bug (mentioned on IRC) has been fixed ?

> diff --git a/configure.ac b/configure.ac
> index e3048c7..64f3e6c 100644
> --- a/configure.ac
> +++ b/configure.ac

> @@ -274,6 +279,9 @@ if test "x$drm_cv_atomic_primitives" = "xnone"; then
>
> LIBDRM_ATOMICS_NOT_FOUND_MSG($TEGRA, tegra, NVIDIA Tegra, 
> tegra-experimental-api)
> TEGRA=no
> +
> +   LIBDRM_ATOMICS_NOT_FOUND_MSG($ETNAVIV, etnaviv, Vivante, 
> etnaviv-experimental-api)
Reading this hunk reminds me what a bad name I've used. Then again
nothing better comes up atm. If you can think of any please shout.

> +++ b/etnaviv/Android.mk
Have you tried building/using etna on Android ?


> +++ b/etnaviv/Makefile.am
> @@ -0,0 +1,27 @@
> +AUTOMAKE_OPTIONS=subdir-objects
There are no subdirectories so you don't need this. Then again, can we
move the freedreno one to configure.ac - just append to
AM_INIT_AUTOMAKE.

> +include Makefile.sources
> +
> +AM_CFLAGS = \
> +   $(WARN_CFLAGS) \
> +   -I$(top_srcdir) \
> +   $(PTHREADSTUBS_CFLAGS) \
> +   -I$(top_srcdir)/include/drm
> +
> +libdrm_etnaviv_ladir = $(libdir)
> +libdrm_etnaviv_la_LTLIBRARIES = libdrm_etnaviv.la
> +libdrm_etnaviv_la_LDFLAGS = -version-number 0:0:0 -no-undefined
Maybe make this 1:0:0 ?

> --- /dev/null
> +++ b/etnaviv/etnaviv-symbol-check
> @@ -0,0 +1,45 @@
> +#!/bin/bash
> +
> +# The following symbols (past the first five) are taken from the public 
> headers.
> +# A list of the latter should be available 
> Makefile.sources/LIBDRM_FREEDRENO_H_FILES
> +
LIBDRM_ETNAVIV_H_FILES?


> new file mode 100644
> index 000..462241c
> --- /dev/null
> +++ b/etnaviv/etnaviv_drm.h
Double-checking: this file is identical to the one produced by make
headers_install, correct ?

-Emil


[PATCH 1/2] libdrm: add etnaviv drm support

2016-08-30 Thread Christian Gmeiner
From: The etnaviv authors 

Add the libdrm_etnaviv helper library to encapsulate etnaviv-specific 
interfaces to the DRM.

Signed-off-by: Christian Gmeiner 
Signed-off-by: Lucas Stach 
---
 .gitignore   |   1 +
 Makefile.am  |   6 +
 configure.ac |  16 ++
 etnaviv/Android.mk   |  18 +++
 etnaviv/Makefile.am  |  27 
 etnaviv/Makefile.sources |  12 ++
 etnaviv/etnaviv-symbol-check |  45 ++
 etnaviv/etnaviv_bo.c | 347 +++
 etnaviv/etnaviv_bo_cache.c   | 196 
 etnaviv/etnaviv_cmd_stream.c | 243 ++
 etnaviv/etnaviv_device.c |  96 
 etnaviv/etnaviv_drm.h| 225 
 etnaviv/etnaviv_drmif.h  | 188 +++
 etnaviv/etnaviv_gpu.c| 175 ++
 etnaviv/etnaviv_pipe.c   |  78 ++
 etnaviv/etnaviv_priv.h   | 200 +
 etnaviv/libdrm_etnaviv.pc.in |  11 ++
 17 files changed, 1884 insertions(+)
 create mode 100644 etnaviv/Android.mk
 create mode 100644 etnaviv/Makefile.am
 create mode 100644 etnaviv/Makefile.sources
 create mode 100755 etnaviv/etnaviv-symbol-check
 create mode 100644 etnaviv/etnaviv_bo.c
 create mode 100644 etnaviv/etnaviv_bo_cache.c
 create mode 100644 etnaviv/etnaviv_cmd_stream.c
 create mode 100644 etnaviv/etnaviv_device.c
 create mode 100644 etnaviv/etnaviv_drm.h
 create mode 100644 etnaviv/etnaviv_drmif.h
 create mode 100644 etnaviv/etnaviv_gpu.c
 create mode 100644 etnaviv/etnaviv_pipe.c
 create mode 100644 etnaviv/etnaviv_priv.h
 create mode 100644 etnaviv/libdrm_etnaviv.pc.in

diff --git a/.gitignore b/.gitignore
index a44566f..3226b3a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -57,6 +57,7 @@ libdrm_exynos.pc
 libdrm_freedreno.pc
 libdrm_amdgpu.pc
 libdrm_vc4.pc
+libdrm_etnaviv.pc
 libkms.pc
 libtool
 ltmain.sh
diff --git a/Makefile.am b/Makefile.am
index 2ceb352..630edc4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,6 +36,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \
--enable-freedreno \
--enable-freedreno-kgsl\
--enable-tegra-experimental-api \
+   --enable-etnaviv-experimental-api \
--enable-install-test-programs \
--enable-cairo-tests \
--enable-manpages \
@@ -84,6 +85,10 @@ if HAVE_VC4
 VC4_SUBDIR = vc4
 endif

+if HAVE_ETNAVIV
+ETNAVIV_SUBDIR = etnaviv
+endif
+
 if BUILD_MANPAGES
 if HAVE_MANPAGES_STYLESHEET
 MAN_SUBDIR = man
@@ -102,6 +107,7 @@ SUBDIRS = \
$(FREEDRENO_SUBDIR) \
$(TEGRA_SUBDIR) \
$(VC4_SUBDIR) \
+   $(ETNAVIV_SUBDIR) \
tests \
$(MAN_SUBDIR)

diff --git a/configure.ac b/configure.ac
index e3048c7..64f3e6c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -132,6 +132,11 @@ AC_ARG_ENABLE(vc4,
  [Enable support for vc4's API (default: auto, enabled on arm)]),
  [VC4=$enableval], [VC4=auto])

+AC_ARG_ENABLE(etnaviv-experimental-api,
+ AS_HELP_STRING([--enable-etnaviv-experimental-api],
+ [Enable support for etnaviv's experimental API (default: 
disabled)]),
+ [ETNAVIV=$enableval], [ETNAVIV=no])
+
 AC_ARG_ENABLE(install-test-programs,
  AS_HELP_STRING([--enable-install-test-programs],
  [Install test programs (default: no)]),
@@ -274,6 +279,9 @@ if test "x$drm_cv_atomic_primitives" = "xnone"; then

LIBDRM_ATOMICS_NOT_FOUND_MSG($TEGRA, tegra, NVIDIA Tegra, 
tegra-experimental-api)
TEGRA=no
+
+   LIBDRM_ATOMICS_NOT_FOUND_MSG($ETNAVIV, etnaviv, Vivante, 
etnaviv-experimental-api)
+   ETNAVIV=no
 else
if test "x$INTEL" = xauto; then
case $host_cpu in
@@ -413,6 +421,11 @@ if test "x$VC4" = xyes; then
AC_DEFINE(HAVE_VC4, 1, [Have VC4 support])
 fi

+AM_CONDITIONAL(HAVE_ETNAVIV, [test "x$ETNAVIV" = xyes])
+if test "x$ETNAVIV" = xyes; then
+   AC_DEFINE(HAVE_ETNAVIV, 1, [Have etnaviv support])
+fi
+
 AM_CONDITIONAL(HAVE_INSTALL_TESTS, [test "x$INSTALL_TESTS" = xyes])
 if test "x$INSTALL_TESTS" = xyes; then
AC_DEFINE(HAVE_INSTALL_TESTS, 1, [Install test programs])
@@ -524,6 +537,8 @@ AC_CONFIG_FILES([
tegra/libdrm_tegra.pc
vc4/Makefile
vc4/libdrm_vc4.pc
+   etnaviv/Makefile
+   etnaviv/libdrm_etnaviv.pc
tests/Makefile
tests/modeprint/Makefile
tests/modetest/Makefile
@@ -555,4 +570,5 @@ echo "  EXYNOS API $EXYNOS"
 echo "  Freedreno API  $FREEDRENO (kgsl: $FREEDRENO_KGSL)"
 echo "  Tegra API  $TEGRA"
 echo "  VC4 API$VC4"
+echo "  Etnaviv API$ETNAVIV"
 echo ""
diff --git a/etnaviv/Android.mk b/etnaviv/Android.mk
new file mode 100644
index 000..a3a2295
--- /dev/null
+++ b/etnaviv/Android.mk
@@ -0,0 +1,18 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+# Import variables LIBDRM_ETNAVIV_FILES, LIBDRM_ETNAVIV_H_FILES
+include