Discussion:
[PATCH v1 0/7] Android etnaviv and imx support
Add Reply
Robert Foss
2017-06-15 20:47:52 UTC
Reply
Permalink
Raw Message
This series enables etnaviv and imx for the android platform.
This is done through updating the Android build scripts.

Additionally 4 small fixes are included in the series.

Rob Herring (4):
gallium: os_process fixes for Android
gbm: add XBGR8888 support for dumb buffers
android: enable texture-float
android: add etnaviv driver build support

Robert Foss (1):
egl/android: Fix typ-o

Tomeu Vizoso (2):
etnaviv: Add return statement to etna_amode so compiler is happy
android: build imx-drm winsys

Android.common.mk | 1 +
Android.mk | 6 ++--
src/egl/drivers/dri2/platform_android.c | 2 +-
src/gallium/Android.mk | 2 ++
src/gallium/auxiliary/Android.mk | 5 +--
src/gallium/auxiliary/os/os_process.c | 5 +--
src/gallium/auxiliary/renderonly/renderonly.c | 1 +
src/gallium/drivers/etnaviv/Android.mk | 47 ++++++++++++++++++++++++++
src/gallium/drivers/etnaviv/etnaviv_compiler.c | 2 ++
src/gallium/winsys/etnaviv/drm/Android.mk | 35 +++++++++++++++++++
src/gallium/winsys/imx/drm/Android.mk | 40 ++++++++++++++++++++++
src/gbm/backends/dri/gbm_dri.c | 2 +-
12 files changed, 140 insertions(+), 8 deletions(-)
create mode 100644 src/gallium/drivers/etnaviv/Android.mk
create mode 100644 src/gallium/winsys/etnaviv/drm/Android.mk
create mode 100644 src/gallium/winsys/imx/drm/Android.mk
--
2.11.0
Robert Foss
2017-06-15 20:47:54 UTC
Reply
Permalink
Raw Message
From: Tomeu Vizoso <***@collabora.com>

Signed-off-by: Robert Foss <***@collabora.com>
---
src/gallium/drivers/etnaviv/etnaviv_compiler.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.c b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
index eafb511bb8..8f73113059 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_compiler.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
@@ -885,6 +885,8 @@ etna_amode(struct tgsi_ind_register indirect)
default:
assert(!"Invalid swizzle");
}
+
+ return 0;
}

/* convert destination operand */
--
2.11.0
Emil Velikov
2017-06-16 12:54:17 UTC
Reply
Permalink
Raw Message
Post by Robert Foss
---
src/gallium/drivers/etnaviv/etnaviv_compiler.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.c b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
index eafb511bb8..8f73113059 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_compiler.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
@@ -885,6 +885,8 @@ etna_amode(struct tgsi_ind_register indirect)
assert(!"Invalid swizzle");
}
+
+ return 0;
All the cases are handled correctly and even the default one will
never be reached.
Guess the compiler isn't smart enough, since we're using int:2 while
in reality we're storing an enum and using enum:2 might not always
work.

Alternative solutions is s/assert/unreachable/. The call will be up-to
the etna devs, but including something like the above (in the commit
summary or elsewhere) will be a good idea, IMHO.

-Emil
Christian Gmeiner
2017-06-16 13:24:37 UTC
Reply
Permalink
Raw Message
Post by Emil Velikov
Post by Robert Foss
---
src/gallium/drivers/etnaviv/etnaviv_compiler.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.c b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
index eafb511bb8..8f73113059 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_compiler.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
@@ -885,6 +885,8 @@ etna_amode(struct tgsi_ind_register indirect)
assert(!"Invalid swizzle");
}
+
+ return 0;
All the cases are handled correctly and even the default one will
never be reached.
Guess the compiler isn't smart enough, since we're using int:2 while
in reality we're storing an enum and using enum:2 might not always
work.
Alternative solutions is s/assert/unreachable/. The call will be up-to
the etna devs, but including something like the above (in the commit
summary or elsewhere) will be a good idea, IMHO.
I really like Emil's idea of s/assert/unreachable/

greets
--
Christian Gmeiner, MSc

https://www.youtube.com/user/AloryOFFICIAL
https://soundcloud.com/christian-gmeiner
Chad Versace
2017-06-19 19:52:08 UTC
Reply
Permalink
Raw Message
Post by Christian Gmeiner
Post by Emil Velikov
Post by Robert Foss
---
src/gallium/drivers/etnaviv/etnaviv_compiler.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.c b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
index eafb511bb8..8f73113059 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_compiler.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
@@ -885,6 +885,8 @@ etna_amode(struct tgsi_ind_register indirect)
assert(!"Invalid swizzle");
}
+
+ return 0;
All the cases are handled correctly and even the default one will
never be reached.
Guess the compiler isn't smart enough, since we're using int:2 while
in reality we're storing an enum and using enum:2 might not always
work.
Alternative solutions is s/assert/unreachable/. The call will be up-to
the etna devs, but including something like the above (in the commit
summary or elsewhere) will be a good idea, IMHO.
I really like Emil's idea of s/assert/unreachable/
If you replace assert() with unreachable() for an exhaustive switch
statement, it's best to delete the default case and call unreachable()
*after* the switch statement. That way, if new enums are ever added, the
compiler will emit a -Wswitch warning (which would be otherwise
supressed by the default case); someone will hopefully notice the
warning, fix it, and save users from an out-of-bounds instruction
pointer.
Matt Turner
2017-06-19 21:05:15 UTC
Reply
Permalink
Raw Message
Post by Chad Versace
Post by Christian Gmeiner
Post by Emil Velikov
Post by Robert Foss
---
src/gallium/drivers/etnaviv/etnaviv_compiler.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.c b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
index eafb511bb8..8f73113059 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_compiler.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
@@ -885,6 +885,8 @@ etna_amode(struct tgsi_ind_register indirect)
assert(!"Invalid swizzle");
}
+
+ return 0;
All the cases are handled correctly and even the default one will
never be reached.
Guess the compiler isn't smart enough, since we're using int:2 while
in reality we're storing an enum and using enum:2 might not always
work.
Alternative solutions is s/assert/unreachable/. The call will be up-to
the etna devs, but including something like the above (in the commit
summary or elsewhere) will be a good idea, IMHO.
I really like Emil's idea of s/assert/unreachable/
If you replace assert() with unreachable() for an exhaustive switch
statement, it's best to delete the default case and call unreachable()
*after* the switch statement. That way, if new enums are ever added, the
compiler will emit a -Wswitch warning (which would be otherwise
supressed by the default case); someone will hopefully notice the
warning, fix it, and save users from an out-of-bounds instruction
pointer.
Oh, that's a nice idea. We should fix a lot of existing code to do it that way.
Emil Velikov
2017-06-20 08:11:13 UTC
Reply
Permalink
Raw Message
Post by Chad Versace
Post by Christian Gmeiner
Post by Emil Velikov
Post by Robert Foss
---
src/gallium/drivers/etnaviv/etnaviv_compiler.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.c b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
index eafb511bb8..8f73113059 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_compiler.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
@@ -885,6 +885,8 @@ etna_amode(struct tgsi_ind_register indirect)
assert(!"Invalid swizzle");
}
+
+ return 0;
All the cases are handled correctly and even the default one will
never be reached.
Guess the compiler isn't smart enough, since we're using int:2 while
in reality we're storing an enum and using enum:2 might not always
work.
Alternative solutions is s/assert/unreachable/. The call will be up-to
the etna devs, but including something like the above (in the commit
summary or elsewhere) will be a good idea, IMHO.
I really like Emil's idea of s/assert/unreachable/
If you replace assert() with unreachable() for an exhaustive switch
statement, it's best to delete the default case and call unreachable()
*after* the switch statement. That way, if new enums are ever added, the
compiler will emit a -Wswitch warning (which would be otherwise
supressed by the default case); someone will hopefully notice the
warning, fix it, and save users from an out-of-bounds instruction
pointer.
That's a very good idea, I think various parts of Gallium already use it.

To do that one needs to tweak struct tgsi_ind_register first - see below.
IIRC some versions of GCC have been having issues with explicitly
sized enums, although we already use it elsewhere in Mesa so it's not
a deal breaker.

struct tgsi_ind_register
{
...
- unsigned Swizzle : 2; /* TGSI_SWIZZLE_ */
+ enum tgsi_swizzle Swizzle : 2; /* TGSI_SWIZZLE_ */
...
}

-Emil

Robert Foss
2017-06-15 20:47:53 UTC
Reply
Permalink
Raw Message
Signed-off-by: Robert Foss <***@collabora.com>
---
src/egl/drivers/dri2/platform_android.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 7a73419d14..5550f580a8 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -752,7 +752,7 @@ droid_create_image_from_prime_fd_yuv(_EGLDisplay *disp, _EGLContext *ctx,
}

if (ycbcr.chroma_step == 2) {
- /* Semi-planar Y + CbCr or Y + CbCr format. */
+ /* Semi-planar Y + CbCr or Y + CrCb format. */
const EGLint attr_list_2plane[] = {
EGL_WIDTH, buf->width,
EGL_HEIGHT, buf->height,
--
2.11.0
Eric Engestrom
2017-06-15 21:42:44 UTC
Reply
Permalink
Raw Message
Trivial, so r-b and pushed immediately :)
Post by Robert Foss
---
src/egl/drivers/dri2/platform_android.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 7a73419d14..5550f580a8 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -752,7 +752,7 @@ droid_create_image_from_prime_fd_yuv(_EGLDisplay *disp, _EGLContext *ctx,
}
if (ycbcr.chroma_step == 2) {
- /* Semi-planar Y + CbCr or Y + CbCr format. */
+ /* Semi-planar Y + CbCr or Y + CrCb format. */
const EGLint attr_list_2plane[] = {
EGL_WIDTH, buf->width,
EGL_HEIGHT, buf->height,
--
2.11.0
Robert Foss
2017-06-15 20:47:59 UTC
Reply
Permalink
Raw Message
From: Tomeu Vizoso <***@collabora.com>

Signed-off-by: Tomeu Vizoso <***@collabora.com>
---
Android.mk | 5 +++--
src/gallium/Android.mk | 1 +
src/gallium/winsys/imx/drm/Android.mk | 40 +++++++++++++++++++++++++++++++++++
3 files changed, 44 insertions(+), 2 deletions(-)
create mode 100644 src/gallium/winsys/imx/drm/Android.mk

diff --git a/Android.mk b/Android.mk
index b4dc8321a6..7622004d2d 100644
--- a/Android.mk
+++ b/Android.mk
@@ -24,7 +24,7 @@
# BOARD_GPU_DRIVERS should be defined. The valid values are
#
# classic drivers: i915 i965
-# gallium drivers: swrast freedreno i915g nouveau r300g r600g radeonsi vc4 virgl vmwgfx etnaviv
+# gallium drivers: swrast freedreno i915g nouveau r300g r600g radeonsi vc4 virgl vmwgfx etnaviv imx
#
# The main target is libGLES_mesa. For each classic driver enabled, a DRI
# module will also be built. DRI modules will be loaded by libGLES_mesa.
@@ -57,7 +57,8 @@ gallium_drivers := \
vmwgfx.HAVE_GALLIUM_VMWGFX \
vc4.HAVE_GALLIUM_VC4 \
virgl.HAVE_GALLIUM_VIRGL \
- etnaviv.HAVE_GALLIUM_ETNAVIV
+ etnaviv.HAVE_GALLIUM_ETNAVIV \
+ imx.HAVE_GALLIUM_IMX

ifeq ($(BOARD_GPU_DRIVERS),all)
MESA_BUILD_CLASSIC := $(filter HAVE_%, $(subst ., , $(classic_drivers)))
diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk
index 0280574405..2710831588 100644
--- a/src/gallium/Android.mk
+++ b/src/gallium/Android.mk
@@ -44,6 +44,7 @@ SUBDIRS += winsys/vc4/drm drivers/vc4
SUBDIRS += winsys/virgl/drm winsys/virgl/vtest drivers/virgl
SUBDIRS += winsys/svga/drm drivers/svga
SUBDIRS += winsys/etnaviv/drm drivers/etnaviv drivers/renderonly
+SUBDIRS += winsys/imx/drm
SUBDIRS += state_trackers/dri

# sort to eliminate any duplicates
diff --git a/src/gallium/winsys/imx/drm/Android.mk b/src/gallium/winsys/imx/drm/Android.mk
new file mode 100644
index 0000000000..d4144f34aa
--- /dev/null
+++ b/src/gallium/winsys/imx/drm/Android.mk
@@ -0,0 +1,40 @@
+# Copyright (C) 2016 Linaro, Ltd, Rob Herring <***@kernel.org>
+#
+# 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 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.
+
+LOCAL_PATH := $(call my-dir)
+
+# get C_SOURCES
+#include $(LOCAL_PATH)/Makefile.sources
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := imx_drm_winsys.c
+
+LOCAL_SHARED_LIBRARIES := libdrm_etnaviv
+
+LOCAL_MODULE := libmesa_winsys_imx
+
+include $(GALLIUM_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+ifneq ($(HAVE_GALLIUM_FREEDRENO),)
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_freedreno)
+$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))
+endif
--
2.11.0
Tapani Pälli
2017-06-16 06:29:36 UTC
Reply
Permalink
Raw Message
Post by Robert Foss
---
Android.mk | 5 +++--
src/gallium/Android.mk | 1 +
src/gallium/winsys/imx/drm/Android.mk | 40 +++++++++++++++++++++++++++++++++++
3 files changed, 44 insertions(+), 2 deletions(-)
create mode 100644 src/gallium/winsys/imx/drm/Android.mk
diff --git a/Android.mk b/Android.mk
index b4dc8321a6..7622004d2d 100644
--- a/Android.mk
+++ b/Android.mk
@@ -24,7 +24,7 @@
# BOARD_GPU_DRIVERS should be defined. The valid values are
#
# classic drivers: i915 i965
-# gallium drivers: swrast freedreno i915g nouveau r300g r600g radeonsi vc4 virgl vmwgfx etnaviv
+# gallium drivers: swrast freedreno i915g nouveau r300g r600g radeonsi vc4 virgl vmwgfx etnaviv imx
#
# The main target is libGLES_mesa. For each classic driver enabled, a DRI
# module will also be built. DRI modules will be loaded by libGLES_mesa.
@@ -57,7 +57,8 @@ gallium_drivers := \
vmwgfx.HAVE_GALLIUM_VMWGFX \
vc4.HAVE_GALLIUM_VC4 \
virgl.HAVE_GALLIUM_VIRGL \
- etnaviv.HAVE_GALLIUM_ETNAVIV
+ etnaviv.HAVE_GALLIUM_ETNAVIV \
+ imx.HAVE_GALLIUM_IMX
ifeq ($(BOARD_GPU_DRIVERS),all)
MESA_BUILD_CLASSIC := $(filter HAVE_%, $(subst ., , $(classic_drivers)))
diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk
index 0280574405..2710831588 100644
--- a/src/gallium/Android.mk
+++ b/src/gallium/Android.mk
@@ -44,6 +44,7 @@ SUBDIRS += winsys/vc4/drm drivers/vc4
SUBDIRS += winsys/virgl/drm winsys/virgl/vtest drivers/virgl
SUBDIRS += winsys/svga/drm drivers/svga
SUBDIRS += winsys/etnaviv/drm drivers/etnaviv drivers/renderonly
+SUBDIRS += winsys/imx/drm
SUBDIRS += state_trackers/dri
# sort to eliminate any duplicates
diff --git a/src/gallium/winsys/imx/drm/Android.mk b/src/gallium/winsys/imx/drm/Android.mk
new file mode 100644
index 0000000000..d4144f34aa
--- /dev/null
+++ b/src/gallium/winsys/imx/drm/Android.mk
@@ -0,0 +1,40 @@
+#
+# 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
+#
+# The above copyright notice and this permission notice 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.
+
+LOCAL_PATH := $(call my-dir)
+
+# get C_SOURCES
+#include $(LOCAL_PATH)/Makefile.sources
copypaste leftover? can be removed
Post by Robert Foss
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := imx_drm_winsys.c
+
+LOCAL_SHARED_LIBRARIES := libdrm_etnaviv
+
+LOCAL_MODULE := libmesa_winsys_imx
+
+include $(GALLIUM_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+ifneq ($(HAVE_GALLIUM_FREEDRENO),)
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_freedreno)
+$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))
+endif
Emil Velikov
2017-06-16 13:59:58 UTC
Reply
Permalink
Raw Message
Hi Rob,

I missed something in the pl111+vc4 case, which is also applicable here.

If one selects the DC w/o the GPU the build will fail. To resolve that
one option is to simply pull the GPU static libs as dependencies for
the DC ones. Some example/specifics below.
Post by Robert Foss
--- /dev/null
+++ b/src/gallium/winsys/imx/drm/Android.mk
+# get C_SOURCES
+#include $(LOCAL_PATH)/Makefile.sources
As with 6/7 uncomment + use the C_SOURCES.
Post by Robert Foss
+
+ifneq ($(HAVE_GALLIUM_FREEDRENO),)
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_freedreno)
Typo - s/libmesa_winsys_freedreno/libmesa_winsys_imx/

+ need the libmesa_pipe_etnaviv and libmesa_winsys_etnaviv as
mentioned above, otherwise we'll fail at build time when etnaviv is
not explicitly set. If you can think of alternative ways to address
this, please go ahead.

Thanks
Emil
Robert Foss
2017-06-15 20:47:57 UTC
Reply
Permalink
Raw Message
From: Rob Herring <***@kernel.org>

This is required by freedreno at least for GLES3 support.

See docs/patents.txt for information about turning this on for s/w
renderers.

Signed-off-by: Rob Herring <***@kernel.org>
---
Android.common.mk | 1 +
1 file changed, 1 insertion(+)

diff --git a/Android.common.mk b/Android.common.mk
index 6bd30816bc..6f93c828b0 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -67,6 +67,7 @@ LOCAL_CFLAGS += \
-DHAVE_DLOPEN \
-DHAVE_DL_ITERATE_PHDR \
-DMAJOR_IN_SYSMACROS \
+ -DTEXTURE_FLOAT_ENABLED \
-fvisibility=hidden \
-Wno-sign-compare
--
2.11.0
Emil Velikov
2017-06-16 13:18:14 UTC
Reply
Permalink
Raw Message
Post by Robert Foss
This is required by freedreno at least for GLES3 support.
See docs/patents.txt for information about turning this on for s/w
renderers.
I'm inclined to agree with Tapani. We're not lawyers and with the
patent expiring in half a year, I think we can defer this toggle to
builders and their legal teams ;-)

-Emil
Rob Clark
2017-06-16 13:25:49 UTC
Reply
Permalink
Raw Message
Post by Emil Velikov
Post by Robert Foss
This is required by freedreno at least for GLES3 support.
See docs/patents.txt for information about turning this on for s/w
renderers.
I'm inclined to agree with Tapani. We're not lawyers and with the
patent expiring in half a year, I think we can defer this toggle to
builders and their legal teams ;-)
Not really sure what msg from Tapani you are referring to. But tbh,
what we really want is a separate option for sw renderers.

I'm not sure if there is any use to build swrast/llvmpipe for android
build, so maybe the thing to do is remove them (if they are built for
android currently), and then enable texture-float.

BR,
-R
Emil Velikov
2017-06-16 13:49:12 UTC
Reply
Permalink
Raw Message
Post by Rob Clark
Post by Emil Velikov
Post by Robert Foss
This is required by freedreno at least for GLES3 support.
See docs/patents.txt for information about turning this on for s/w
renderers.
I'm inclined to agree with Tapani. We're not lawyers and with the
patent expiring in half a year, I think we can defer this toggle to
builders and their legal teams ;-)
Not really sure what msg from Tapani you are referring to. But tbh,
what we really want is a separate option for sw renderers.
This quote from the cover letter
"I'm not sure about patch to enable texture-float, should this be left
as a 'policy decision' for end distribution, it's not enabled by
default on desktop?"
Post by Rob Clark
I'm not sure if there is any use to build swrast/llvmpipe for android
build, so maybe the thing to do is remove them (if they are built for
android currently), and then enable texture-float.
There was a similar idea on the autotools side, but it never really
got finished/ack/merged.

I realise it's a tad annoying, but I'd just give it until the patent
expires and enable it everywhere - we could even fold the s3tc code
within mesa.

-Emil
Rob Clark
2017-06-16 14:30:33 UTC
Reply
Permalink
Raw Message
Post by Emil Velikov
Post by Rob Clark
Post by Emil Velikov
Post by Robert Foss
This is required by freedreno at least for GLES3 support.
See docs/patents.txt for information about turning this on for s/w
renderers.
I'm inclined to agree with Tapani. We're not lawyers and with the
patent expiring in half a year, I think we can defer this toggle to
builders and their legal teams ;-)
Not really sure what msg from Tapani you are referring to. But tbh,
what we really want is a separate option for sw renderers.
This quote from the cover letter
"I'm not sure about patch to enable texture-float, should this be left
as a 'policy decision' for end distribution, it's not enabled by
default on desktop?"
I think the only reason it isn't enabled by default is because
(currently) the same option covers both hw drivers and sw drivers.
Otoh, i965 ignores this option and always advertised texture-float.

Anyways, if android has some way to conditionalize this based on some
var set in board file, that might be an option. Ideally I think we
want to get to the point where we can build android with upstream
mesa, without having to carry patches.

BR,
-R
Post by Emil Velikov
Post by Rob Clark
I'm not sure if there is any use to build swrast/llvmpipe for android
build, so maybe the thing to do is remove them (if they are built for
android currently), and then enable texture-float.
There was a similar idea on the autotools side, but it never really
got finished/ack/merged.
I realise it's a tad annoying, but I'd just give it until the patent
expires and enable it everywhere - we could even fold the s3tc code
within mesa.
-Emil
Emil Velikov
2017-06-16 14:46:18 UTC
Reply
Permalink
Raw Message
Post by Rob Clark
Post by Emil Velikov
Post by Rob Clark
Post by Emil Velikov
Post by Robert Foss
This is required by freedreno at least for GLES3 support.
See docs/patents.txt for information about turning this on for s/w
renderers.
I'm inclined to agree with Tapani. We're not lawyers and with the
patent expiring in half a year, I think we can defer this toggle to
builders and their legal teams ;-)
Not really sure what msg from Tapani you are referring to. But tbh,
what we really want is a separate option for sw renderers.
This quote from the cover letter
"I'm not sure about patch to enable texture-float, should this be left
as a 'policy decision' for end distribution, it's not enabled by
default on desktop?"
I think the only reason it isn't enabled by default is because
(currently) the same option covers both hw drivers and sw drivers.
Otoh, i965 ignores this option and always advertised texture-float.
Anyways, if android has some way to conditionalize this based on some
var set in board file, that might be an option. Ideally I think we
want to get to the point where we can build android with upstream
mesa, without having to carry patches.
Fully support the zero patches topic. Yet since none of us is a lawyer
so it's understandable to be cautious ;-)
If people agree to enable it for non SW drivers, be that like i965 or
otherwise, let's have that consistent across Mesa.

Emil
Ian Romanick
2017-06-19 02:15:50 UTC
Reply
Permalink
Raw Message
Post by Rob Clark
Post by Emil Velikov
Post by Robert Foss
This is required by freedreno at least for GLES3 support.
See docs/patents.txt for information about turning this on for s/w
renderers.
I'm inclined to agree with Tapani. We're not lawyers and with the
patent expiring in half a year, I think we can defer this toggle to
builders and their legal teams ;-)
Not really sure what msg from Tapani you are referring to. But tbh,
what we really want is a separate option for sw renderers.
As far as I'm aware, when SGI still existed, their position was that the
patent didn't even apply to software renderers. I *thought* Dave added
the option because he didn't want Red Hat to be exposed if whoever owned
the IP got sue happy about enabling a hardware implementation (i.e.,
contributory infringement).
Post by Rob Clark
I'm not sure if there is any use to build swrast/llvmpipe for android
build, so maybe the thing to do is remove them (if they are built for
android currently), and then enable texture-float.
BR,
-R
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Matt Turner
2017-06-16 14:45:52 UTC
Reply
Permalink
Raw Message
Post by Emil Velikov
Post by Robert Foss
This is required by freedreno at least for GLES3 support.
See docs/patents.txt for information about turning this on for s/w
renderers.
I'm inclined to agree with Tapani. We're not lawyers and with the
patent expiring in half a year, I think we can defer this toggle to
builders and their legal teams ;-)
It's not expiring in half a year.

ARB_texture_float references US Patent #6,650,327 [1]: which was filed
June 16 1998.

According to [2], the patent expires 20 years from the filing date,
giving an expiration of June 17 2018. So, 1 year and 1 day.

And for good measure, the patent on S3TC [3] expires Oct 2 2017. I
think we should have a party :)

[1] https://www.google.com/patents/US6650327
[2] https://en.wikipedia.org/wiki/Term_of_patent_in_the_United_States
[3] https://www.google.com/patents/US6775417
Emil Velikov
2017-06-16 14:51:53 UTC
Reply
Permalink
Raw Message
Post by Matt Turner
Post by Emil Velikov
Post by Robert Foss
This is required by freedreno at least for GLES3 support.
See docs/patents.txt for information about turning this on for s/w
renderers.
I'm inclined to agree with Tapani. We're not lawyers and with the
patent expiring in half a year, I think we can defer this toggle to
builders and their legal teams ;-)
It's not expiring in half a year.
ARB_texture_float references US Patent #6,650,327 [1]: which was filed
June 16 1998.
According to [2], the patent expires 20 years from the filing date,
giving an expiration of June 17 2018. So, 1 year and 1 day.
And for good measure, the patent on S3TC [3] expires Oct 2 2017. I
think we should have a party :)
Apologies for the mix up and thanks for the correction Matt. A S3TC
goodbye party sounds like a plan ;-)

-Emil
Ian Romanick
2017-06-18 22:36:30 UTC
Reply
Permalink
Raw Message
Post by Robert Foss
This is required by freedreno at least for GLES3 support.
See docs/patents.txt for information about turning this on for s/w
renderers.
If I'm not mistaken (I'm not a lawyer, and I don't play one on TV), that
patent is going to expire at about this time next year!
Post by Robert Foss
---
Android.common.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/Android.common.mk b/Android.common.mk
index 6bd30816bc..6f93c828b0 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -67,6 +67,7 @@ LOCAL_CFLAGS += \
-DHAVE_DLOPEN \
-DHAVE_DL_ITERATE_PHDR \
-DMAJOR_IN_SYSMACROS \
+ -DTEXTURE_FLOAT_ENABLED \
-fvisibility=hidden \
-Wno-sign-compare
Robert Foss
2017-06-15 20:47:58 UTC
Reply
Permalink
Raw Message
From: Rob Herring <***@kernel.org>

Add etnaviv to Android makefiles.

Signed-off-by: Rob Herring <***@kernel.org>
---
Android.mk | 5 +--
src/gallium/Android.mk | 1 +
src/gallium/auxiliary/Android.mk | 5 +--
src/gallium/auxiliary/renderonly/renderonly.c | 1 +
src/gallium/drivers/etnaviv/Android.mk | 47 +++++++++++++++++++++++++++
src/gallium/winsys/etnaviv/drm/Android.mk | 35 ++++++++++++++++++++
6 files changed, 90 insertions(+), 4 deletions(-)
create mode 100644 src/gallium/drivers/etnaviv/Android.mk
create mode 100644 src/gallium/winsys/etnaviv/drm/Android.mk

diff --git a/Android.mk b/Android.mk
index de37f4600f..b4dc8321a6 100644
--- a/Android.mk
+++ b/Android.mk
@@ -24,7 +24,7 @@
# BOARD_GPU_DRIVERS should be defined. The valid values are
#
# classic drivers: i915 i965
-# gallium drivers: swrast freedreno i915g nouveau r300g r600g radeonsi vc4 virgl vmwgfx
+# gallium drivers: swrast freedreno i915g nouveau r300g r600g radeonsi vc4 virgl vmwgfx etnaviv
#
# The main target is libGLES_mesa. For each classic driver enabled, a DRI
# module will also be built. DRI modules will be loaded by libGLES_mesa.
@@ -56,7 +56,8 @@ gallium_drivers := \
radeonsi.HAVE_GALLIUM_RADEONSI \
vmwgfx.HAVE_GALLIUM_VMWGFX \
vc4.HAVE_GALLIUM_VC4 \
- virgl.HAVE_GALLIUM_VIRGL
+ virgl.HAVE_GALLIUM_VIRGL \
+ etnaviv.HAVE_GALLIUM_ETNAVIV

ifeq ($(BOARD_GPU_DRIVERS),all)
MESA_BUILD_CLASSIC := $(filter HAVE_%, $(subst ., , $(classic_drivers)))
diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk
index 0915579127..0280574405 100644
--- a/src/gallium/Android.mk
+++ b/src/gallium/Android.mk
@@ -43,6 +43,7 @@ SUBDIRS += winsys/radeon/drm winsys/amdgpu/drm drivers/radeonsi drivers/radeon
SUBDIRS += winsys/vc4/drm drivers/vc4
SUBDIRS += winsys/virgl/drm winsys/virgl/vtest drivers/virgl
SUBDIRS += winsys/svga/drm drivers/svga
+SUBDIRS += winsys/etnaviv/drm drivers/etnaviv drivers/renderonly
SUBDIRS += state_trackers/dri

# sort to eliminate any duplicates
diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk
index e2a1fc214e..a562774a9a 100644
--- a/src/gallium/auxiliary/Android.mk
+++ b/src/gallium/auxiliary/Android.mk
@@ -31,7 +31,8 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(C_SOURCES) \
$(NIR_SOURCES) \
- $(VL_STUB_SOURCES)
+ $(VL_STUB_SOURCES) \
+ $(RENDERONLY_SOURCES)

LOCAL_C_INCLUDES := \
$(GALLIUM_TOP)/auxiliary/util
@@ -46,7 +47,7 @@ LOCAL_CPPFLAGS += -std=c++11

# We need libmesa_nir to get NIR's generated include directories.
LOCAL_MODULE := libmesa_gallium
-LOCAL_STATIC_LIBRARIES += libmesa_nir
+LOCAL_STATIC_LIBRARIES += libmesa_nir libmesa_loader

LOCAL_WHOLE_STATIC_LIBRARIES += cpufeatures

diff --git a/src/gallium/auxiliary/renderonly/renderonly.c b/src/gallium/auxiliary/renderonly/renderonly.c
index d3ed214f4e..dda7f4471a 100644
--- a/src/gallium/auxiliary/renderonly/renderonly.c
+++ b/src/gallium/auxiliary/renderonly/renderonly.c
@@ -35,6 +35,7 @@
#include "pipe/p_screen.h"
#include "util/u_inlines.h"
#include "util/u_memory.h"
+#include "loader.h"

struct renderonly *
renderonly_dup(const struct renderonly *ro)
diff --git a/src/gallium/drivers/etnaviv/Android.mk b/src/gallium/drivers/etnaviv/Android.mk
new file mode 100644
index 0000000000..7e9b2ae1b2
--- /dev/null
+++ b/src/gallium/drivers/etnaviv/Android.mk
@@ -0,0 +1,47 @@
+# Copyright (C) 2016 Linaro, Ltd, Rob Herring <***@kernel.org>
+#
+# 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 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.
+
+LOCAL_PATH := $(call my-dir)
+
+# get C_SOURCES
+include $(LOCAL_PATH)/Makefile.sources
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(C_SOURCES)
+
+LOCAL_C_INCLUDES := \
+ $(LOCAL_PATH)/hw
+
+#LOCAL_GENERATED_SOURCES := $(MESA_GEN_NIR_H)
+
+LOCAL_SHARED_LIBRARIES := libdrm_etnaviv
+#LOCAL_STATIC_LIBRARIES := libmesa_glsl libmesa_nir
+LOCAL_MODULE := libmesa_pipe_etnaviv
+
+#include $(LOCAL_PATH)/Android.gen.mk
+include $(GALLIUM_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+ifneq ($(HAVE_GALLIUM_ETNAVIV),)
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_etnaviv)
+$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))
+endif
diff --git a/src/gallium/winsys/etnaviv/drm/Android.mk b/src/gallium/winsys/etnaviv/drm/Android.mk
new file mode 100644
index 0000000000..0bf0bb4485
--- /dev/null
+++ b/src/gallium/winsys/etnaviv/drm/Android.mk
@@ -0,0 +1,35 @@
+# Copyright (C) 2016 Linaro, Ltd, Rob Herring <***@kernel.org>
+#
+# 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 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.
+
+LOCAL_PATH := $(call my-dir)
+
+# get C_SOURCES
+#include $(LOCAL_PATH)/Makefile.sources
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := etnaviv_drm_winsys.c
+
+LOCAL_SHARED_LIBRARIES := libdrm_etnaviv
+
+LOCAL_MODULE := libmesa_winsys_etnaviv
+
+include $(GALLIUM_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
--
2.11.0
Tapani Pälli
2017-06-16 06:28:22 UTC
Reply
Permalink
Raw Message
Post by Robert Foss
Add etnaviv to Android makefiles.
---
Android.mk | 5 +--
src/gallium/Android.mk | 1 +
src/gallium/auxiliary/Android.mk | 5 +--
src/gallium/auxiliary/renderonly/renderonly.c | 1 +
src/gallium/drivers/etnaviv/Android.mk | 47 +++++++++++++++++++++++++++
src/gallium/winsys/etnaviv/drm/Android.mk | 35 ++++++++++++++++++++
6 files changed, 90 insertions(+), 4 deletions(-)
create mode 100644 src/gallium/drivers/etnaviv/Android.mk
create mode 100644 src/gallium/winsys/etnaviv/drm/Android.mk
diff --git a/Android.mk b/Android.mk
index de37f4600f..b4dc8321a6 100644
--- a/Android.mk
+++ b/Android.mk
@@ -24,7 +24,7 @@
# BOARD_GPU_DRIVERS should be defined. The valid values are
#
# classic drivers: i915 i965
-# gallium drivers: swrast freedreno i915g nouveau r300g r600g radeonsi vc4 virgl vmwgfx
+# gallium drivers: swrast freedreno i915g nouveau r300g r600g radeonsi vc4 virgl vmwgfx etnaviv
#
# The main target is libGLES_mesa. For each classic driver enabled, a DRI
# module will also be built. DRI modules will be loaded by libGLES_mesa.
@@ -56,7 +56,8 @@ gallium_drivers := \
radeonsi.HAVE_GALLIUM_RADEONSI \
vmwgfx.HAVE_GALLIUM_VMWGFX \
vc4.HAVE_GALLIUM_VC4 \
- virgl.HAVE_GALLIUM_VIRGL
+ virgl.HAVE_GALLIUM_VIRGL \
+ etnaviv.HAVE_GALLIUM_ETNAVIV
ifeq ($(BOARD_GPU_DRIVERS),all)
MESA_BUILD_CLASSIC := $(filter HAVE_%, $(subst ., , $(classic_drivers)))
diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk
index 0915579127..0280574405 100644
--- a/src/gallium/Android.mk
+++ b/src/gallium/Android.mk
@@ -43,6 +43,7 @@ SUBDIRS += winsys/radeon/drm winsys/amdgpu/drm drivers/radeonsi drivers/radeon
SUBDIRS += winsys/vc4/drm drivers/vc4
SUBDIRS += winsys/virgl/drm winsys/virgl/vtest drivers/virgl
SUBDIRS += winsys/svga/drm drivers/svga
+SUBDIRS += winsys/etnaviv/drm drivers/etnaviv drivers/renderonly
SUBDIRS += state_trackers/dri
# sort to eliminate any duplicates
diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk
index e2a1fc214e..a562774a9a 100644
--- a/src/gallium/auxiliary/Android.mk
+++ b/src/gallium/auxiliary/Android.mk
@@ -31,7 +31,8 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(C_SOURCES) \
$(NIR_SOURCES) \
- $(VL_STUB_SOURCES)
+ $(VL_STUB_SOURCES) \
+ $(RENDERONLY_SOURCES)
LOCAL_C_INCLUDES := \
$(GALLIUM_TOP)/auxiliary/util
@@ -46,7 +47,7 @@ LOCAL_CPPFLAGS += -std=c++11
# We need libmesa_nir to get NIR's generated include directories.
LOCAL_MODULE := libmesa_gallium
-LOCAL_STATIC_LIBRARIES += libmesa_nir
+LOCAL_STATIC_LIBRARIES += libmesa_nir libmesa_loader
LOCAL_WHOLE_STATIC_LIBRARIES += cpufeatures
diff --git a/src/gallium/auxiliary/renderonly/renderonly.c b/src/gallium/auxiliary/renderonly/renderonly.c
index d3ed214f4e..dda7f4471a 100644
--- a/src/gallium/auxiliary/renderonly/renderonly.c
+++ b/src/gallium/auxiliary/renderonly/renderonly.c
@@ -35,6 +35,7 @@
#include "pipe/p_screen.h"
#include "util/u_inlines.h"
#include "util/u_memory.h"
+#include "loader.h"
struct renderonly *
renderonly_dup(const struct renderonly *ro)
diff --git a/src/gallium/drivers/etnaviv/Android.mk b/src/gallium/drivers/etnaviv/Android.mk
new file mode 100644
index 0000000000..7e9b2ae1b2
--- /dev/null
+++ b/src/gallium/drivers/etnaviv/Android.mk
@@ -0,0 +1,47 @@
+#
+# 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
+#
+# The above copyright notice and this permission notice 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.
+
+LOCAL_PATH := $(call my-dir)
+
+# get C_SOURCES
+include $(LOCAL_PATH)/Makefile.sources
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(C_SOURCES)
+
+LOCAL_C_INCLUDES := \
+ $(LOCAL_PATH)/hw
+
+#LOCAL_GENERATED_SOURCES := $(MESA_GEN_NIR_H)
+
+LOCAL_SHARED_LIBRARIES := libdrm_etnaviv
+#LOCAL_STATIC_LIBRARIES := libmesa_glsl libmesa_nir
+LOCAL_MODULE := libmesa_pipe_etnaviv
+
+#include $(LOCAL_PATH)/Android.gen.mk
+include $(GALLIUM_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+ifneq ($(HAVE_GALLIUM_ETNAVIV),)
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_etnaviv)
+$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))
+endif
diff --git a/src/gallium/winsys/etnaviv/drm/Android.mk b/src/gallium/winsys/etnaviv/drm/Android.mk
new file mode 100644
index 0000000000..0bf0bb4485
--- /dev/null
+++ b/src/gallium/winsys/etnaviv/drm/Android.mk
@@ -0,0 +1,35 @@
+#
+# 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
+#
+# The above copyright notice and this permission notice 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.
+
+LOCAL_PATH := $(call my-dir)
+
+# get C_SOURCES
+#include $(LOCAL_PATH)/Makefile.sources
copypaste leftover? can be removed
Post by Robert Foss
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := etnaviv_drm_winsys.c
+
+LOCAL_SHARED_LIBRARIES := libdrm_etnaviv
+
+LOCAL_MODULE := libmesa_winsys_etnaviv
+
+include $(GALLIUM_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
Tapani Pälli
2017-06-16 06:30:22 UTC
Reply
Permalink
Raw Message
Post by Tapani Pälli
Post by Robert Foss
Add etnaviv to Android makefiles.
---
Android.mk | 5 +--
src/gallium/Android.mk | 1 +
src/gallium/auxiliary/Android.mk | 5 +--
src/gallium/auxiliary/renderonly/renderonly.c | 1 +
src/gallium/drivers/etnaviv/Android.mk | 47
+++++++++++++++++++++++++++
src/gallium/winsys/etnaviv/drm/Android.mk | 35 ++++++++++++++++++++
6 files changed, 90 insertions(+), 4 deletions(-)
create mode 100644 src/gallium/drivers/etnaviv/Android.mk
create mode 100644 src/gallium/winsys/etnaviv/drm/Android.mk
diff --git a/Android.mk b/Android.mk
index de37f4600f..b4dc8321a6 100644
--- a/Android.mk
+++ b/Android.mk
@@ -24,7 +24,7 @@
# BOARD_GPU_DRIVERS should be defined. The valid values are
#
# classic drivers: i915 i965
-# gallium drivers: swrast freedreno i915g nouveau r300g r600g
radeonsi vc4 virgl vmwgfx
+# gallium drivers: swrast freedreno i915g nouveau r300g r600g
radeonsi vc4 virgl vmwgfx etnaviv
#
# The main target is libGLES_mesa. For each classic driver enabled, a DRI
# module will also be built. DRI modules will be loaded by
libGLES_mesa.
@@ -56,7 +56,8 @@ gallium_drivers := \
radeonsi.HAVE_GALLIUM_RADEONSI \
vmwgfx.HAVE_GALLIUM_VMWGFX \
vc4.HAVE_GALLIUM_VC4 \
- virgl.HAVE_GALLIUM_VIRGL
+ virgl.HAVE_GALLIUM_VIRGL \
+ etnaviv.HAVE_GALLIUM_ETNAVIV
ifeq ($(BOARD_GPU_DRIVERS),all)
MESA_BUILD_CLASSIC := $(filter HAVE_%, $(subst ., ,
$(classic_drivers)))
diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk
index 0915579127..0280574405 100644
--- a/src/gallium/Android.mk
+++ b/src/gallium/Android.mk
@@ -43,6 +43,7 @@ SUBDIRS += winsys/radeon/drm winsys/amdgpu/drm
drivers/radeonsi drivers/radeon
SUBDIRS += winsys/vc4/drm drivers/vc4
SUBDIRS += winsys/virgl/drm winsys/virgl/vtest drivers/virgl
SUBDIRS += winsys/svga/drm drivers/svga
+SUBDIRS += winsys/etnaviv/drm drivers/etnaviv drivers/renderonly
SUBDIRS += state_trackers/dri
# sort to eliminate any duplicates
diff --git a/src/gallium/auxiliary/Android.mk
b/src/gallium/auxiliary/Android.mk
index e2a1fc214e..a562774a9a 100644
--- a/src/gallium/auxiliary/Android.mk
+++ b/src/gallium/auxiliary/Android.mk
@@ -31,7 +31,8 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(C_SOURCES) \
$(NIR_SOURCES) \
- $(VL_STUB_SOURCES)
+ $(VL_STUB_SOURCES) \
+ $(RENDERONLY_SOURCES)
LOCAL_C_INCLUDES := \
$(GALLIUM_TOP)/auxiliary/util
@@ -46,7 +47,7 @@ LOCAL_CPPFLAGS += -std=c++11
# We need libmesa_nir to get NIR's generated include directories.
LOCAL_MODULE := libmesa_gallium
-LOCAL_STATIC_LIBRARIES += libmesa_nir
+LOCAL_STATIC_LIBRARIES += libmesa_nir libmesa_loader
LOCAL_WHOLE_STATIC_LIBRARIES += cpufeatures
diff --git a/src/gallium/auxiliary/renderonly/renderonly.c
b/src/gallium/auxiliary/renderonly/renderonly.c
index d3ed214f4e..dda7f4471a 100644
--- a/src/gallium/auxiliary/renderonly/renderonly.c
+++ b/src/gallium/auxiliary/renderonly/renderonly.c
@@ -35,6 +35,7 @@
#include "pipe/p_screen.h"
#include "util/u_inlines.h"
#include "util/u_memory.h"
+#include "loader.h"
struct renderonly *
renderonly_dup(const struct renderonly *ro)
diff --git a/src/gallium/drivers/etnaviv/Android.mk
b/src/gallium/drivers/etnaviv/Android.mk
new file mode 100644
index 0000000000..7e9b2ae1b2
--- /dev/null
+++ b/src/gallium/drivers/etnaviv/Android.mk
@@ -0,0 +1,47 @@
+#
+# 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
+#
+# The above copyright notice and this permission notice 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.
+
+LOCAL_PATH := $(call my-dir)
+
+# get C_SOURCES
+include $(LOCAL_PATH)/Makefile.sources
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(C_SOURCES)
+
+LOCAL_C_INCLUDES := \
+ $(LOCAL_PATH)/hw
+
+#LOCAL_GENERATED_SOURCES := $(MESA_GEN_NIR_H)
this one can be removed as well
Post by Tapani Pälli
Post by Robert Foss
+
+LOCAL_SHARED_LIBRARIES := libdrm_etnaviv
+#LOCAL_STATIC_LIBRARIES := libmesa_glsl libmesa_nir
and this too
Post by Tapani Pälli
Post by Robert Foss
+LOCAL_MODULE := libmesa_pipe_etnaviv
+
+#include $(LOCAL_PATH)/Android.gen.mk
+include $(GALLIUM_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+ifneq ($(HAVE_GALLIUM_ETNAVIV),)
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_etnaviv)
+$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))
+endif
diff --git a/src/gallium/winsys/etnaviv/drm/Android.mk
b/src/gallium/winsys/etnaviv/drm/Android.mk
new file mode 100644
index 0000000000..0bf0bb4485
--- /dev/null
+++ b/src/gallium/winsys/etnaviv/drm/Android.mk
@@ -0,0 +1,35 @@
+#
+# 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
+#
+# The above copyright notice and this permission notice 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.
+
+LOCAL_PATH := $(call my-dir)
+
+# get C_SOURCES
+#include $(LOCAL_PATH)/Makefile.sources
copypaste leftover? can be removed
Post by Robert Foss
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := etnaviv_drm_winsys.c
+
+LOCAL_SHARED_LIBRARIES := libdrm_etnaviv
+
+LOCAL_MODULE := libmesa_winsys_etnaviv
+
+include $(GALLIUM_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Emil Velikov
2017-06-16 13:24:41 UTC
Reply
Permalink
Raw Message
Hi Rob,

There's a handful of small nitpicks, but nothing serious.
Post by Robert Foss
Add etnaviv to Android makefiles.
---
Android.mk | 5 +--
src/gallium/Android.mk | 1 +
src/gallium/auxiliary/Android.mk | 5 +--
src/gallium/auxiliary/renderonly/renderonly.c | 1 +
src/gallium/drivers/etnaviv/Android.mk | 47 +++++++++++++++++++++++++++
src/gallium/winsys/etnaviv/drm/Android.mk | 35 ++++++++++++++++++++
6 files changed, 90 insertions(+), 4 deletions(-)
create mode 100644 src/gallium/drivers/etnaviv/Android.mk
create mode 100644 src/gallium/winsys/etnaviv/drm/Android.mk
diff --git a/Android.mk b/Android.mk
index de37f4600f..b4dc8321a6 100644
--- a/Android.mk
+++ b/Android.mk
@@ -24,7 +24,7 @@
# BOARD_GPU_DRIVERS should be defined. The valid values are
#
# classic drivers: i915 i965
-# gallium drivers: swrast freedreno i915g nouveau r300g r600g radeonsi vc4 virgl vmwgfx
+# gallium drivers: swrast freedreno i915g nouveau r300g r600g radeonsi vc4 virgl vmwgfx etnaviv
#
# The main target is libGLES_mesa. For each classic driver enabled, a DRI
# module will also be built. DRI modules will be loaded by libGLES_mesa.
@@ -56,7 +56,8 @@ gallium_drivers := \
radeonsi.HAVE_GALLIUM_RADEONSI \
vmwgfx.HAVE_GALLIUM_VMWGFX \
vc4.HAVE_GALLIUM_VC4 \
- virgl.HAVE_GALLIUM_VIRGL
+ virgl.HAVE_GALLIUM_VIRGL \
+ etnaviv.HAVE_GALLIUM_ETNAVIV
ifeq ($(BOARD_GPU_DRIVERS),all)
MESA_BUILD_CLASSIC := $(filter HAVE_%, $(subst ., , $(classic_drivers)))
diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk
index 0915579127..0280574405 100644
--- a/src/gallium/Android.mk
+++ b/src/gallium/Android.mk
@@ -43,6 +43,7 @@ SUBDIRS += winsys/radeon/drm winsys/amdgpu/drm drivers/radeonsi drivers/radeon
SUBDIRS += winsys/vc4/drm drivers/vc4
SUBDIRS += winsys/virgl/drm winsys/virgl/vtest drivers/virgl
SUBDIRS += winsys/svga/drm drivers/svga
+SUBDIRS += winsys/etnaviv/drm drivers/etnaviv drivers/renderonly
SUBDIRS += state_trackers/dri
# sort to eliminate any duplicates
diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk
index e2a1fc214e..a562774a9a 100644
--- a/src/gallium/auxiliary/Android.mk
+++ b/src/gallium/auxiliary/Android.mk
@@ -31,7 +31,8 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(C_SOURCES) \
$(NIR_SOURCES) \
- $(VL_STUB_SOURCES)
+ $(VL_STUB_SOURCES) \
+ $(RENDERONLY_SOURCES)
LOCAL_C_INCLUDES := \
$(GALLIUM_TOP)/auxiliary/util
@@ -46,7 +47,7 @@ LOCAL_CPPFLAGS += -std=c++11
# We need libmesa_nir to get NIR's generated include directories.
LOCAL_MODULE := libmesa_gallium
-LOCAL_STATIC_LIBRARIES += libmesa_nir
+LOCAL_STATIC_LIBRARIES += libmesa_nir libmesa_loader
Do we really need the loader here? Afaict module does not export any
headers/etc that we need?
We should only need it in the final link stage, although it's there already.
Post by Robert Foss
LOCAL_WHOLE_STATIC_LIBRARIES += cpufeatures
diff --git a/src/gallium/auxiliary/renderonly/renderonly.c b/src/gallium/auxiliary/renderonly/renderonly.c
index d3ed214f4e..dda7f4471a 100644
--- a/src/gallium/auxiliary/renderonly/renderonly.c
+++ b/src/gallium/auxiliary/renderonly/renderonly.c
@@ -35,6 +35,7 @@
#include "pipe/p_screen.h"
#include "util/u_inlines.h"
#include "util/u_memory.h"
+#include "loader.h"
Seemingly unrelated change. Please split out if we really need it.
Post by Robert Foss
struct renderonly *
renderonly_dup(const struct renderonly *ro)
diff --git a/src/gallium/drivers/etnaviv/Android.mk b/src/gallium/drivers/etnaviv/Android.mk
new file mode 100644
index 0000000000..7e9b2ae1b2
--- /dev/null
+++ b/src/gallium/drivers/etnaviv/Android.mk
@@ -0,0 +1,47 @@
+#
+# 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
+#
+# The above copyright notice and this permission notice 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.
+
+LOCAL_PATH := $(call my-dir)
+
+# get C_SOURCES
+include $(LOCAL_PATH)/Makefile.sources
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ $(C_SOURCES)
+
+LOCAL_C_INCLUDES := \
+ $(LOCAL_PATH)/hw
+
Cannot see this include in the Automake build so, it doesn't seem like
we need it?
Post by Robert Foss
+#LOCAL_GENERATED_SOURCES := $(MESA_GEN_NIR_H)
+
+LOCAL_SHARED_LIBRARIES := libdrm_etnaviv
+#LOCAL_STATIC_LIBRARIES := libmesa_glsl libmesa_nir
+LOCAL_MODULE := libmesa_pipe_etnaviv
+
+#include $(LOCAL_PATH)/Android.gen.mk
Please drop the commented out lines.
Post by Robert Foss
--- /dev/null
+++ b/src/gallium/winsys/etnaviv/drm/Android.mk
+# get C_SOURCES
+#include $(LOCAL_PATH)/Makefile.sources
Uncomment this line...
Post by Robert Foss
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := etnaviv_drm_winsys.c
... and use the sources variable $(C_SOURCES)

-Emil
Rob Herring
2017-06-16 14:13:27 UTC
Reply
Permalink
Raw Message
Post by Emil Velikov
Hi Rob,
There's a handful of small nitpicks, but nothing serious.
Post by Robert Foss
Add etnaviv to Android makefiles.
---
@@ -46,7 +47,7 @@ LOCAL_CPPFLAGS += -std=c++11
# We need libmesa_nir to get NIR's generated include directories.
LOCAL_MODULE := libmesa_gallium
-LOCAL_STATIC_LIBRARIES += libmesa_nir
+LOCAL_STATIC_LIBRARIES += libmesa_nir libmesa_loader
Do we really need the loader here? Afaict module does not export any
headers/etc that we need?
We should only need it in the final link stage, although it's there already.
I could be left over from the first iteration of renderonly. These
patches started a while back.

Rob
Robert Foss
2017-06-15 20:47:55 UTC
Reply
Permalink
Raw Message
From: Rob Herring <***@kernel.org>

Signed-off-by: Rob Herring <***@kernel.org>
---
src/gallium/auxiliary/os/os_process.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_process.c b/src/gallium/auxiliary/os/os_process.c
index 6622b9b2bc..af5d22bf84 100644
--- a/src/gallium/auxiliary/os/os_process.c
+++ b/src/gallium/auxiliary/os/os_process.c
@@ -34,7 +34,7 @@
# include <windows.h>
#elif defined(__GLIBC__) || defined(__CYGWIN__)
# include <errno.h>
-#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
+#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_ANDROID)
# include <stdlib.h>
#elif defined(PIPE_OS_HAIKU)
# include <kernel/OS.h>
@@ -59,6 +59,7 @@ os_get_process_name(char *procname, size_t size)
{
const char *name;

+
/* First, check if the GALLIUM_PROCESS_NAME env var is set to
* override the normal process name query.
*/
@@ -86,7 +87,7 @@ os_get_process_name(char *procname, size_t size)

#elif defined(__GLIBC__) || defined(__CYGWIN__)
name = program_invocation_short_name;
-#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
+#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_ANDROID)
/* *BSD and OS X */
name = getprogname();
#elif defined(PIPE_OS_HAIKU)
--
2.11.0
Chih-Wei Huang
2017-06-16 03:38:52 UTC
Reply
Permalink
Raw Message
Post by Robert Foss
---
src/gallium/auxiliary/os/os_process.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/gallium/auxiliary/os/os_process.c b/src/gallium/auxiliary/os/os_process.c
index 6622b9b2bc..af5d22bf84 100644
--- a/src/gallium/auxiliary/os/os_process.c
+++ b/src/gallium/auxiliary/os/os_process.c
@@ -34,7 +34,7 @@
# include <windows.h>
#elif defined(__GLIBC__) || defined(__CYGWIN__)
# include <errno.h>
-#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
+#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_ANDROID)
# include <stdlib.h>
#elif defined(PIPE_OS_HAIKU)
# include <kernel/OS.h>
@@ -59,6 +59,7 @@ os_get_process_name(char *procname, size_t size)
{
const char *name;
+
/* First, check if the GALLIUM_PROCESS_NAME env var is set to
* override the normal process name query.
*/
@@ -86,7 +87,7 @@ os_get_process_name(char *procname, size_t size)
#elif defined(__GLIBC__) || defined(__CYGWIN__)
name = program_invocation_short_name;
-#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
+#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_ANDROID)
/* *BSD and OS X */
name = getprogname();
#elif defined(PIPE_OS_HAIKU)
--
I have submitted another patch to fix
the same issue about 2 weeks ago.
My suggestion is just define PIPE_OS_BSD
for Android. This allows Android to share features
inherited from (Open)BSD and avoid further changes
like this one.

Please see:
https://lists.freedesktop.org/archives/mesa-dev/2017-June/157754.html
--
Chih-Wei
Android-x86 project
http://www.android-x86.org
Emil Velikov
2017-06-16 12:59:37 UTC
Reply
Permalink
Raw Message
Post by Chih-Wei Huang
Post by Robert Foss
---
src/gallium/auxiliary/os/os_process.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/gallium/auxiliary/os/os_process.c b/src/gallium/auxiliary/os/os_process.c
index 6622b9b2bc..af5d22bf84 100644
--- a/src/gallium/auxiliary/os/os_process.c
+++ b/src/gallium/auxiliary/os/os_process.c
@@ -34,7 +34,7 @@
# include <windows.h>
#elif defined(__GLIBC__) || defined(__CYGWIN__)
# include <errno.h>
-#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
+#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_ANDROID)
# include <stdlib.h>
#elif defined(PIPE_OS_HAIKU)
# include <kernel/OS.h>
@@ -59,6 +59,7 @@ os_get_process_name(char *procname, size_t size)
{
const char *name;
+
Unrelated whitespace change.
Post by Chih-Wei Huang
Post by Robert Foss
/* First, check if the GALLIUM_PROCESS_NAME env var is set to
* override the normal process name query.
*/
@@ -86,7 +87,7 @@ os_get_process_name(char *procname, size_t size)
#elif defined(__GLIBC__) || defined(__CYGWIN__)
name = program_invocation_short_name;
-#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
+#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_ANDROID)
/* *BSD and OS X */
name = getprogname();
#elif defined(PIPE_OS_HAIKU)
--
I have submitted another patch to fix
the same issue about 2 weeks ago.
My suggestion is just define PIPE_OS_BSD
for Android. This allows Android to share features
inherited from (Open)BSD and avoid further changes
like this one.
https://lists.freedesktop.org/archives/mesa-dev/2017-June/157754.html
And as mentioned in the thread - assuming both BSD and Linux does not
sound like a good idea.
Let's go ahead with this, but Rob please apply some polish on the
commit message. Some example follows:

"gallium: android: use BSD code path for os_get_process_name

The function getprogname() is available on Android, since it reuses
various BSD solutions C runtime."

With the above
Reviewed-by: Emil Velikov <***@collabora.com>

-Emil
Robert Foss
2017-06-15 20:47:56 UTC
Reply
Permalink
Raw Message
From: Rob Herring <***@kernel.org>

Signed-off-by: Rob Herring <***@kernel.org>
---
src/gbm/backends/dri/gbm_dri.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 19be440d48..58b62ac361 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -1067,7 +1067,7 @@ create_dumb(struct gbm_device *gbm,
is_cursor = (usage & GBM_BO_USE_CURSOR) != 0 &&
format == GBM_FORMAT_ARGB8888;
is_scanout = (usage & GBM_BO_USE_SCANOUT) != 0 &&
- format == GBM_FORMAT_XRGB8888;
+ (format == GBM_FORMAT_XRGB8888 || format == GBM_FORMAT_XBGR8888);
if (!is_cursor && !is_scanout) {
errno = EINVAL;
return NULL;
--
2.11.0
Emil Velikov
2017-06-16 13:16:19 UTC
Reply
Permalink
Raw Message
Post by Robert Foss
---
src/gbm/backends/dri/gbm_dri.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 19be440d48..58b62ac361 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -1067,7 +1067,7 @@ create_dumb(struct gbm_device *gbm,
is_cursor = (usage & GBM_BO_USE_CURSOR) != 0 &&
format == GBM_FORMAT_ARGB8888;
is_scanout = (usage & GBM_BO_USE_SCANOUT) != 0 &&
- format == GBM_FORMAT_XRGB8888;
+ (format == GBM_FORMAT_XRGB8888 || format == GBM_FORMAT_XBGR8888);
AFAICT there's no other parts that need updating.

Still, the commit message should mention, an actual use case for the
extra format.

With that
Reviewed-by: Emil Velikov <***@collabora.com>

Emil
Daniel Stone
2017-06-16 13:40:11 UTC
Reply
Permalink
Raw Message
Hi,
Post by Robert Foss
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 19be440d48..58b62ac361 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -1067,7 +1067,7 @@ create_dumb(struct gbm_device *gbm,
is_cursor = (usage & GBM_BO_USE_CURSOR) != 0 &&
format == GBM_FORMAT_ARGB8888;
is_scanout = (usage & GBM_BO_USE_SCANOUT) != 0 &&
- format == GBM_FORMAT_XRGB8888;
+ (format == GBM_FORMAT_XRGB8888 || format == GBM_FORMAT_XBGR8888);
Funny, I've just been exactly here myself, cursing at the weird and
asymmetric hardcoded list of formats. Good times.

Reviewed-by: Daniel Stone <***@collabora.com>

Cheers,
Daniel
Tapani Pälli
2017-06-16 06:33:13 UTC
Reply
Permalink
Raw Message
I sent some small nitpicking on commented lines in mk files, otherwise
everything LGTM.

I'm not sure about patch to enable texture-float, should this be left as
a 'policy decision' for end distribution, it's not enabled by default on
desktop?

other patches (with those small nits fixed) are
Post by Robert Foss
This series enables etnaviv and imx for the android platform.
This is done through updating the Android build scripts.
Additionally 4 small fixes are included in the series.
gallium: os_process fixes for Android
gbm: add XBGR8888 support for dumb buffers
android: enable texture-float
android: add etnaviv driver build support
egl/android: Fix typ-o
etnaviv: Add return statement to etna_amode so compiler is happy
android: build imx-drm winsys
Android.common.mk | 1 +
Android.mk | 6 ++--
src/egl/drivers/dri2/platform_android.c | 2 +-
src/gallium/Android.mk | 2 ++
src/gallium/auxiliary/Android.mk | 5 +--
src/gallium/auxiliary/os/os_process.c | 5 +--
src/gallium/auxiliary/renderonly/renderonly.c | 1 +
src/gallium/drivers/etnaviv/Android.mk | 47 ++++++++++++++++++++++++++
src/gallium/drivers/etnaviv/etnaviv_compiler.c | 2 ++
src/gallium/winsys/etnaviv/drm/Android.mk | 35 +++++++++++++++++++
src/gallium/winsys/imx/drm/Android.mk | 40 ++++++++++++++++++++++
src/gbm/backends/dri/gbm_dri.c | 2 +-
12 files changed, 140 insertions(+), 8 deletions(-)
create mode 100644 src/gallium/drivers/etnaviv/Android.mk
create mode 100644 src/gallium/winsys/etnaviv/drm/Android.mk
create mode 100644 src/gallium/winsys/imx/drm/Android.mk
Loading...