size *= sizeof(info->batch[0]);
ret = drm_intel_bo_subdata(info->batch_ibo, 0, size, info->batch);
if (ret) {
- LOGE("failed to subdata batch");
+ ALOGE("failed to subdata batch");
goto fail;
}
ret = drm_intel_bo_exec(info->batch_ibo, size, NULL, 0, 0);
if (ret) {
- LOGE("failed to exec batch");
+ ALOGE("failed to exec batch");
goto fail;
}
dst->handle->height != src->handle->height ||
dst->handle->stride != src->handle->stride ||
dst->handle->format != src->handle->format) {
- LOGE("copy between incompatible buffers");
+ ALOGE("copy between incompatible buffers");
return;
}
cmd |= XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB;
break;
default:
- LOGE("copy with unsupported format");
+ ALOGE("copy with unsupported format");
return;
}
flags = 0;
bpp = gralloc_drm_get_bpp(handle->format);
if (!bpp) {
- LOGE("unrecognized format 0x%x", handle->format);
+ ALOGE("unrecognized format 0x%x", handle->format);
return NULL;
}
+ aligned_width = handle->width;
+ aligned_height = handle->height;
+ gralloc_drm_align_geometry(handle->format,
+ &aligned_width, &aligned_height);
+
if (handle->usage & GRALLOC_USAGE_HW_FB) {
unsigned long max_stride;
max_stride /= 2;
name = "gralloc-fb";
- aligned_width = (handle->width + 63) & ~63;
- aligned_height = handle->height;
+ aligned_width = (aligned_width + 63) & ~63;
flags = BO_ALLOC_FOR_RENDER;
*tiling = I915_TILING_X;
if (handle->usage & GRALLOC_USAGE_HW_TEXTURE) {
name = "gralloc-texture";
/* see 2D texture layout of DRI drivers */
- aligned_width = (handle->width + 3) & ~3;
- aligned_height = (handle->height + 1) & ~1;
+ aligned_width = (aligned_width + 3) & ~3;
+ aligned_height = (aligned_height + 1) & ~1;
}
else {
name = "gralloc-buffer";
- aligned_width = handle->width;
- aligned_height = handle->height;
}
if (handle->usage & GRALLOC_USAGE_HW_RENDER)
ib->ibo = drm_intel_bo_gem_create_from_name(info->bufmgr,
"gralloc-r", handle->name);
if (!ib->ibo) {
- LOGE("failed to create ibo from name %u",
+ ALOGE("failed to create ibo from name %u",
handle->name);
free(ib);
return NULL;
}
if (drm_intel_bo_get_tiling(ib->ibo, &ib->tiling, &dummy)) {
- LOGE("failed to get ibo tiling");
+ ALOGE("failed to get ibo tiling");
drm_intel_bo_unreference(ib->ibo);
free(ib);
return NULL;
ib->ibo = alloc_ibo(info, handle, &ib->tiling, &stride);
if (!ib->ibo) {
- LOGE("failed to allocate ibo %dx%d (format %d)",
+ ALOGE("failed to allocate ibo %dx%d (format %d)",
handle->width,
handle->height,
handle->format);
handle->stride = stride;
if (drm_intel_bo_flink(ib->ibo, (uint32_t *) &handle->name)) {
- LOGE("failed to flink ibo");
+ ALOGE("failed to flink ibo");
drm_intel_bo_unreference(ib->ibo);
free(ib);
return NULL;
struct drm_i915_getparam gp;
int pageflipping, id;
- drm->fb_format = HAL_PIXEL_FORMAT_BGRA_8888;
+ switch (drm->fb_format) {
+ case HAL_PIXEL_FORMAT_BGRA_8888:
+ case HAL_PIXEL_FORMAT_RGB_565:
+ break;
+ default:
+ drm->fb_format = HAL_PIXEL_FORMAT_BGRA_8888;
+ break;
+ }
- drm->mode_dirty_fb = 0;
+ drm->mode_quirk_vmwgfx = 0;
/* why? */
drm->mode_sync_flip = 1;
info = calloc(1, sizeof(*info));
if (!info) {
- LOGE("failed to allocate driver info");
+ ALOGE("failed to allocate driver info");
return NULL;
}
info->fd = fd;
info->bufmgr = drm_intel_bufmgr_gem_init(info->fd, 16 * 1024);
if (!info->bufmgr) {
- LOGE("failed to create buffer manager");
+ ALOGE("failed to create buffer manager");
free(info);
return NULL;
}