From 32a0f80413b322c7f17d0f921094c22c5304cc3f Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 7 Aug 2009 19:09:35 -0700 Subject: [PATCH] make sure to use the right 32-bit pixelformat on msm7k when using the gpu --- libcopybit/copybit.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libcopybit/copybit.cpp b/libcopybit/copybit.cpp index f734b73..8347a0c 100644 --- a/libcopybit/copybit.cpp +++ b/libcopybit/copybit.cpp @@ -123,8 +123,15 @@ static void set_image(struct mdp_img *img, const struct copybit_image_t *rhs) img->format = get_format(rhs->format); img->offset = hnd->offset; #if defined(COPYBIT_MSM7K) - img->memory_id = (hnd->flags & private_handle_t::PRIV_FLAGS_USES_GPU) - ? hnd->gpu_fd : hnd->fd; + if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_GPU) { + img->memory_id = hnd->gpu_fd; + if (img->format == MDP_RGBA_8888) { + // msm7201A GPU only supports BGRA_8888 destinations + img->format = MDP_BGRA_8888; + } + } else { + img->memory_id = hnd->fd; + } #else img->memory_id = hnd->fd; #endif