diff options
-rw-r--r-- | Android.mk | 6 | ||||
-rw-r--r-- | gralloc_drm.c | 13 | ||||
-rw-r--r-- | gralloc_drm_handle.h | 4 | ||||
-rw-r--r-- | gralloc_drm_kms.c | 7 | ||||
-rw-r--r-- | gralloc_drm_radeon.c | 4 |
5 files changed, 18 insertions, 16 deletions
@@ -25,7 +25,7 @@ DRM_GPU_DRIVERS := $(strip $(filter-out swrast, $(BOARD_GPU_DRIVERS))) freedreno_drivers := freedreno intel_drivers := i915 i965 i915g ilo -radeon_drivers := r300g r600g +radeon_drivers := r300g r600g radeonsi nouveau_drivers := nouveau vmwgfx_drivers := vmwgfx @@ -70,7 +70,7 @@ include $(BUILD_PREBUILT) include $(CLEAR_VARS) LOCAL_MODULE := gralloc.$(TARGET_PRODUCT) LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw/ +LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_SRC_FILES := ../../$(BOARD_GPU_DRIVER_BINARY) LOCAL_MODULE_CLASS := SHARED_LIBRARIES LOCAL_MODULE_SUFFIX := $(TARGET_SHLIB_SUFFIX) @@ -163,7 +163,7 @@ LOCAL_SHARED_LIBRARIES += \ LOCAL_MODULE := gralloc.drm LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw/ +LOCAL_MODULE_RELATIVE_PATH := hw include $(BUILD_SHARED_LIBRARY) endif # DRM_GPU_DRIVERS=prebuilt diff --git a/gralloc_drm.c b/gralloc_drm.c index a175cbe..3478dde 100644 --- a/gralloc_drm.c +++ b/gralloc_drm.c @@ -225,10 +225,10 @@ static struct gralloc_drm_bo_t *validate_handle(buffer_handle_t _handle, } handle->data_owner = gralloc_drm_get_pid(); - handle->data = (int) bo; + handle->data = bo; } - return (struct gralloc_drm_bo_t *) handle->data; + return handle->data; } /* @@ -310,7 +310,7 @@ struct gralloc_drm_bo_t *gralloc_drm_bo_create(struct gralloc_drm_t *drm, bo->refcount = 1; handle->data_owner = gralloc_drm_get_pid(); - handle->data = (int) bo; + handle->data = bo; return bo; } @@ -379,7 +379,7 @@ void gralloc_drm_resolve_format(buffer_handle_t _handle, uint32_t *pitches, uint32_t *offsets, uint32_t *handles) { struct gralloc_drm_handle_t *handle = gralloc_drm_handle(_handle); - struct gralloc_drm_bo_t *bo = (struct gralloc_drm_bo_t *) handle->data; + struct gralloc_drm_bo_t *bo = handle->data; struct gralloc_drm_t *drm = bo->drm; /* if handle exists and driver implements resolve_format */ @@ -398,8 +398,9 @@ int gralloc_drm_bo_lock(struct gralloc_drm_bo_t *bo, if ((bo->handle->usage & usage) != usage) { /* make FB special for testing software renderer with */ - if (!(bo->handle->usage & GRALLOC_USAGE_HW_FB) - && !(bo->handle->usage & GRALLOC_USAGE_HW_TEXTURE)) { + if (!(bo->handle->usage & GRALLOC_USAGE_SW_READ_OFTEN) && + !(bo->handle->usage & GRALLOC_USAGE_HW_FB) && + !(bo->handle->usage & GRALLOC_USAGE_HW_TEXTURE)) { ALOGE("bo.usage:x%X/usage:x%X is not GRALLOC_USAGE_HW_FB or GRALLOC_USAGE_HW_TEXTURE" ,bo->handle->usage,usage); return -EINVAL; diff --git a/gralloc_drm_handle.h b/gralloc_drm_handle.h index f7b03b2..7fc4746 100644 --- a/gralloc_drm_handle.h +++ b/gralloc_drm_handle.h @@ -31,6 +31,8 @@ extern "C" { #endif +struct gralloc_drm_bo_t; + struct gralloc_drm_handle_t { native_handle_t base; @@ -50,7 +52,7 @@ struct gralloc_drm_handle_t { int stride; /* the stride in bytes */ int data_owner; /* owner of data (for validation) */ - int data; /* pointer to struct gralloc_drm_bo_t */ + struct gralloc_drm_bo_t *data; /* pointer to struct gralloc_drm_bo_t */ }; static inline struct gralloc_drm_handle_t *gralloc_drm_handle(buffer_handle_t _handle) diff --git a/gralloc_drm_kms.c b/gralloc_drm_kms.c index 0909361..cb02a13 100644 --- a/gralloc_drm_kms.c +++ b/gralloc_drm_kms.c @@ -299,7 +299,7 @@ int gralloc_drm_reserve_plane(struct gralloc_drm_t *drm, uint32_t src_w, uint32_t src_h) { - unsigned int i, j; + int j; struct gralloc_drm_handle_t *drm_handle = gralloc_drm_handle(handle); int plane_count = drm->plane_resources->count_planes; @@ -1092,15 +1092,14 @@ int gralloc_drm_init_kms(struct gralloc_drm_t *drm) if (!drm->plane_resources) { ALOGD("no planes found from drm resources"); } else { + unsigned int i, j; + ALOGD("supported drm planes and formats"); /* fill a helper structure for hwcomposer */ drm->planes = calloc(drm->plane_resources->count_planes, sizeof(struct gralloc_drm_plane_t)); for (i = 0; i < drm->plane_resources->count_planes; i++) { - - unsigned int j; - drm->planes[i].drm_plane = drmModeGetPlane(drm->fd, drm->plane_resources->planes[i]); diff --git a/gralloc_drm_radeon.c b/gralloc_drm_radeon.c index 2911a45..8320989 100644 --- a/gralloc_drm_radeon.c +++ b/gralloc_drm_radeon.c @@ -353,7 +353,7 @@ static int radeon_init_tile_config(struct radeon_info *info) memset(&ginfo, 0, sizeof(ginfo)); ginfo.request = RADEON_INFO_TILING_CONFIG; - ginfo.value = (long) &val; + ginfo.value = (uintptr_t) &val; ret = drmCommandWriteRead(info->fd, DRM_RADEON_INFO, &ginfo, sizeof(ginfo)); if (ret) @@ -465,7 +465,7 @@ static int radeon_probe(struct radeon_info *info) memset(&kinfo, 0, sizeof(kinfo)); kinfo.request = RADEON_INFO_DEVICE_ID; - kinfo.value = (long) &info->chipset; + kinfo.value = (uintptr_t) &info->chipset; err = drmCommandWriteRead(info->fd, DRM_RADEON_INFO, &kinfo, sizeof(kinfo)); if (err) { ALOGE("failed to get device id"); |