Commit bb0fd5f3 authored by Tomasz Figa's avatar Tomasz Figa Committed by Emil Velikov
Browse files

intel: Do not use libpciaccess on Android



This patch makes the code not rely anymore on libpciaccess when compiled
for Android to eliminate ioperm() and iopl() syscalls required by that
library. As a side effect, the mappable aperture size is hardcoded to 64
MiB on Android, however nothing seems to rely on this value anyway, as
checked be grepping relevant code in drm_gralloc and Mesa.

Cc: Rob Herring <rob.herring@linaro.org>
Signed-off-by: default avatarTomasz Figa <tfiga@google.com>
[Emil Velikov: rebase against master. add missing __func__, Eric]
Signed-off-by: Emil Velikov's avatarEmil Velikov <emil.velikov@collabora.com>
Acked-by: John Stultz's avatarJohn Stultz <john.stultz@linaro.org>
parent 00aa3744
...@@ -33,8 +33,7 @@ LOCAL_MODULE := libdrm_intel ...@@ -33,8 +33,7 @@ LOCAL_MODULE := libdrm_intel
LOCAL_SRC_FILES := $(LIBDRM_INTEL_FILES) LOCAL_SRC_FILES := $(LIBDRM_INTEL_FILES)
LOCAL_SHARED_LIBRARIES := \ LOCAL_SHARED_LIBRARIES := \
libdrm \ libdrm
libpciaccess
include $(LIBDRM_COMMON_MK) include $(LIBDRM_COMMON_MK)
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)
......
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
#include <errno.h> #include <errno.h>
#include <drm.h> #include <drm.h>
#include <i915_drm.h> #include <i915_drm.h>
#ifndef __ANDROID__
#include <pciaccess.h> #include <pciaccess.h>
#endif
#include "libdrm_macros.h" #include "libdrm_macros.h"
#include "intel_bufmgr.h" #include "intel_bufmgr.h"
#include "intel_bufmgr_priv.h" #include "intel_bufmgr_priv.h"
...@@ -322,6 +324,7 @@ drm_intel_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, int crtc_id) ...@@ -322,6 +324,7 @@ drm_intel_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, int crtc_id)
return -1; return -1;
} }
#ifndef __ANDROID__
static size_t static size_t
drm_intel_probe_agp_aperture_size(int fd) drm_intel_probe_agp_aperture_size(int fd)
{ {
...@@ -347,6 +350,15 @@ err: ...@@ -347,6 +350,15 @@ err:
pci_system_cleanup (); pci_system_cleanup ();
return size; return size;
} }
#else
static size_t
drm_intel_probe_agp_aperture_size(int fd)
{
/* Nothing seems to rely on this value on Android anyway... */
fprintf(stderr, "%s: Mappable aperture size hardcoded to 64MiB\n", __func__);
return 64 * 1024 * 1024;
}
#endif
int int
drm_intel_get_aperture_sizes(int fd, size_t *mappable, size_t *total) drm_intel_get_aperture_sizes(int fd, size_t *mappable, size_t *total)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment