[cairo] [PATCH 54/54] drm/intel: fixed unitialized variable warning and improved error handling
Enrico Weigelt, metux IT consult
enrico.weigelt at gr13.net
Wed Dec 23 02:23:38 PST 2015
Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt at gr13.net>
---
src/drm/cairo-drm-i915-surface.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/drm/cairo-drm-i915-surface.c b/src/drm/cairo-drm-i915-surface.c
index c83e3db..ab1e997 100644
--- a/src/drm/cairo-drm-i915-surface.c
+++ b/src/drm/cairo-drm-i915-surface.c
@@ -2516,11 +2516,6 @@ i915_buffer_cache_init (intel_buffer_cache_t *cache,
cache->buffer.height = height;
switch (format) {
- case CAIRO_FORMAT_INVALID:
- case CAIRO_FORMAT_A1:
- case CAIRO_FORMAT_RGB24:
- case CAIRO_FORMAT_RGB16_565:
- ASSERT_NOT_REACHED;
case CAIRO_FORMAT_RGB30:
case CAIRO_FORMAT_ARGB32:
cache->buffer.map0 = MAPSURF_32BIT | MT_32BIT_ARGB8888;
@@ -2530,6 +2525,12 @@ i915_buffer_cache_init (intel_buffer_cache_t *cache,
cache->buffer.map0 = MAPSURF_8BIT | MT_8BIT_I8;
stride = width;
break;
+ case CAIRO_FORMAT_INVALID:
+ case CAIRO_FORMAT_A1:
+ case CAIRO_FORMAT_RGB24:
+ case CAIRO_FORMAT_RGB16_565:
+ default:
+ return _cairo_error (CAIRO_STATUS_INVALID_FORMAT);
}
assert ((stride & 7) == 0);
assert (i915_tiling_stride (tiling, stride) == stride);
--
2.6.4.442.g545299f
More information about the cairo
mailing list