Android: kill off {MESA_}ANDROID_VERSION defines aka Android 4.1 and older
authorRob Herring <robh@kernel.org>
Tue, 21 Mar 2017 18:51:19 +0000 (13:51 -0500)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 22 Mar 2017 17:52:57 +0000 (17:52 +0000)
The Android version defines are only needed for versions less than 4.2
which aren't really supported or tested.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Android.common.mk
Android.mk
src/egl/Android.mk
src/egl/drivers/dri2/egl_dri2.h
src/egl/drivers/dri2/platform_android.c

index 062f8328d87daf2b1f5f6d57fa76d3f7cf0961c9..cd576152da7f28e4b0c60d625f156670ec2f8435 100644 (file)
@@ -30,7 +30,6 @@ LOCAL_C_INCLUDES += \
        $(MESA_TOP)/include
 
 MESA_VERSION := $(shell cat $(MESA_TOP)/VERSION)
-# define ANDROID_VERSION (e.g., 4.0.x => 0x0400)
 LOCAL_CFLAGS += \
        -Wno-unused-parameter \
        -Wno-date-time \
@@ -39,8 +38,7 @@ LOCAL_CFLAGS += \
        -Wno-initializer-overrides \
        -Wno-mismatched-tags \
        -DPACKAGE_VERSION=\"$(MESA_VERSION)\" \
-       -DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\" \
-       -DANDROID_VERSION=0x0$(MESA_ANDROID_MAJOR_VERSION)0$(MESA_ANDROID_MINOR_VERSION)
+       -DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\"
 
 LOCAL_CFLAGS += \
        -DENABLE_SHADER_CACHE \
index 9afa415dd7447fcadd607ef11654f5494ee300c9..07a6cbae748645db2d23744d6375ba4e5e7dc221 100644 (file)
@@ -33,7 +33,6 @@ MESA_TOP := $(call my-dir)
 
 MESA_ANDROID_MAJOR_VERSION := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
 MESA_ANDROID_MINOR_VERSION := $(word 2, $(subst ., , $(PLATFORM_VERSION)))
-MESA_ANDROID_VERSION := $(MESA_ANDROID_MAJOR_VERSION).$(MESA_ANDROID_MINOR_VERSION)
 ifeq ($(filter 1 2 3 4,$(MESA_ANDROID_MAJOR_VERSION)),)
 MESA_LOLLIPOP_BUILD := true
 else
index 0227ad82c673449acaddf30c604d2909ec8f2587..56d8859dd5f285e1c0feec8d796a6bad330046da 100644 (file)
@@ -55,11 +55,8 @@ LOCAL_SHARED_LIBRARIES := \
        libhardware \
        liblog \
        libcutils \
-       libgralloc_drm
-
-ifeq ($(shell echo "$(MESA_ANDROID_VERSION) >= 4.2" | bc),1)
-LOCAL_SHARED_LIBRARIES += libsync
-endif
+       libgralloc_drm \
+       libsync
 
 ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
 # require i915_dri and/or i965_dri
index 230c0663d3c06f79b7e512084b49d7d16286c26d..f16663712d3f5328d705325cd0d8ce8e1f2600e1 100644 (file)
 #ifdef HAVE_ANDROID_PLATFORM
 #define LOG_TAG "EGL-DRI2"
 
-#if ANDROID_VERSION >= 0x0400
-#  include <system/window.h>
-#else
-#  define android_native_buffer_t ANativeWindowBuffer
-#  include <ui/egl/android_natives.h>
-#  include <ui/android_native_buffer.h>
-#endif
-
+#include <system/window.h>
 #include <hardware/gralloc.h>
 #include <gralloc_drm_handle.h>
 #include <cutils/log.h>
index 667e08b345122764b40dbffc18ce8a34bd215fe3..6cbe119b024b9bd979ffcf10c09086e96b52e894 100644 (file)
 #include <fcntl.h>
 #include <xf86drm.h>
 #include <stdbool.h>
-
-#if ANDROID_VERSION >= 0x402
 #include <sync/sync.h>
-#endif
 
 #include "loader.h"
 #include "egl_dri2.h"
@@ -160,7 +157,6 @@ get_native_buffer_name(struct ANativeWindowBuffer *buf)
 static EGLBoolean
 droid_window_dequeue_buffer(struct dri2_egl_surface *dri2_surf)
 {
-#if ANDROID_VERSION >= 0x0402
    int fence_fd;
 
    if (dri2_surf->window->dequeueBuffer(dri2_surf->window, &dri2_surf->buffer,
@@ -195,13 +191,6 @@ droid_window_dequeue_buffer(struct dri2_egl_surface *dri2_surf)
    }
 
    dri2_surf->buffer->common.incRef(&dri2_surf->buffer->common);
-#else
-   if (dri2_surf->window->dequeueBuffer(dri2_surf->window, &dri2_surf->buffer))
-      return EGL_FALSE;
-
-   dri2_surf->buffer->common.incRef(&dri2_surf->buffer->common);
-   dri2_surf->window->lockBuffer(dri2_surf->window, dri2_surf->buffer);
-#endif
 
    /* Record all the buffers created by ANativeWindow and update back buffer
     * for updating buffer's age in swap_buffers.
@@ -244,7 +233,6 @@ droid_window_enqueue_buffer(_EGLDisplay *disp, struct dri2_egl_surface *dri2_sur
     */
    mtx_unlock(&disp->Mutex);
 
-#if ANDROID_VERSION >= 0x0402
    /* Queue the buffer without a sync fence. This informs the ANativeWindow
     * that it may access the buffer immediately.
     *
@@ -260,9 +248,6 @@ droid_window_enqueue_buffer(_EGLDisplay *disp, struct dri2_egl_surface *dri2_sur
    int fence_fd = -1;
    dri2_surf->window->queueBuffer(dri2_surf->window, dri2_surf->buffer,
                                   fence_fd);
-#else
-   dri2_surf->window->queueBuffer(dri2_surf->window, dri2_surf->buffer);
-#endif
 
    dri2_surf->buffer->common.decRef(&dri2_surf->buffer->common);
    dri2_surf->buffer = NULL;