[Mesa-dev] [PATCH 6/8] dri: Convert driCreateConfigs to use a gl_format enum

Ian Romanick idr at freedesktop.org
Mon Oct 29 09:58:24 PDT 2012


On 10/26/2012 11:42 AM, Chad Versace wrote:
> This is great. I wanted to do this when I last touched
> intel_screen_make_dri_configs but was unable to find the motivation.
>
> I have one suggestion below, but that nit doesn't block the patch.
>
> Reviewed-by: Chad Versace <chad.versace at linux.intel.com>
>
>> +   switch (format) {
>> +   case MESA_FORMAT_RGB565:
>> +      masks = masks_table[0];
>> +      break;
>> +   case MESA_FORMAT_XRGB8888:
>> +      masks = masks_table[1];
>> +      break;
>> +   case MESA_FORMAT_ARGB8888:
>> +      masks = masks_table[2];
>> +      break;
>> +   default:
>> +      fprintf(stderr, "[%s:%u] Unknown framebuffer type %s (%d).\n",
>> +              __FUNCTION__, __LINE__,
>> +              _mesa_get_format_name(format), format);
>> +      return NULL;
>>      }
>
> I think _mesa_problem() is more appropriate here than fprintf(). But to call
> _mesa_problem() here you would need to pass ctx=NULL to it, which I'm ok with
> but other people might not like. Meh.

That function originally used fprintf, so I'm inclined to keep it that 
way.  This is a fairly catastrophic situation that should never escape 
testing... the driver says it can handle a format that the shared 
functions can't understand.



More information about the mesa-dev mailing list