Hi, When adding the per-surface color space support to our non-fbdev systems driver, we found that two changes to the color space handling in DFB were required:
The first change was in layer_context.c, while adding color space support in our system driver, to allow the Region to inherit a Layer's color space setting we found we need to transfer the color space setting from Layer config to its Region config in init_region_config(). The second change was in surface.c, added color space handling while re-configuring a surface in function dfb_surface_reconfig(). The prior color space handling resulted in the new surface configuration to have an incompatible pixel format when it switched from RGB-based to YUV-based (and vice versa). This could previously occur when the IDirectFBDisplayLayer_SetConfiguration() function was called and the underlying core surface is re-configured. The patches are provided below as well as attached. diff --git a/src/core/layer_context.c b/src/core/layer_context.c old mode 100644 new mode 100755 index a3415e9..20b0d56 --- a/src/core/layer_context.c +++ b/src/core/layer_context.c @@ -1615,6 +1615,7 @@ init_region_config( CoreLayerContext *context, config->width = context->config.width; config->height = context->config.height; config->format = context->config.pixelformat; + config->colorspace = context->config.colorspace; config->buffermode = context->config.buffermode; config->options = context->config.options; config->source_id = context->config.source; diff --git a/src/core/surface.c b/src/core/surface.c old mode 100644 new mode 100755 index 8e8dbb2..46e1b75 --- a/src/core/surface.c +++ b/src/core/surface.c @@ -546,6 +546,9 @@ dfb_surface_reconfig( CoreSurface *surface, if (config->flags & CSCONF_FORMAT) new_config.format = config->format; + if (config->flags & CSCONF_COLORSPACE) + surface->config.colorspace = config->colorspace; + if (config->flags & CSCONF_CAPS) { if (config->caps & DSCAPS_ROTATED) D_UNIMPLEMENTED(); BR Oliver
color_space.patch
Description: color_space.patch
_______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev