diff options
author | Eric Engestrom <[email protected]> | 2018-05-18 15:53:58 +0100 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2018-05-29 17:44:13 +0100 |
commit | d3ca7bd45223aefc60174ad7c5957d3d5792192a (patch) | |
tree | 6b4ea9ed507e3eb152908b04670b63c887d9a555 | |
parent | 1945231b48df8ffcfa2eb168f81c3f5984433b01 (diff) |
dri: fix error value returned by driGLFormatToImageFormat()
0 is not a valid value for the __DRI_IMAGE_FORMAT_* enum.
It is, however, the value of MESA_FORMAT_NONE, which two of the callers
(i915 & i965) checked for.
The other callers (that check for errors, ie. st/dri) already check for
__DRI_IMAGE_FORMAT_NONE.
Signed-off-by: Eric Engestrom <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_screen.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index c58650491df..d7dff235f2e 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -901,7 +901,7 @@ driGLFormatToImageFormat(mesa_format format) case MESA_FORMAT_B8G8R8A8_SRGB: return __DRI_IMAGE_FORMAT_SARGB8; default: - return 0; + return __DRI_IMAGE_FORMAT_NONE; } } diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index 5024a69bd41..882c498622f 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -415,7 +415,7 @@ intel_create_image_from_texture(__DRIcontext *context, int target, image->data = loaderPrivate; intel_setup_image_from_mipmap_tree(intel, image, iobj->mt, level, zoffset); image->dri_format = driGLFormatToImageFormat(image->format); - if (image->dri_format == MESA_FORMAT_NONE) { + if (image->dri_format == __DRI_IMAGE_FORMAT_NONE) { *error = __DRI_IMAGE_ERROR_BAD_PARAMETER; free(image); return NULL; diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index ab6c003b0fe..935711106c0 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -591,7 +591,7 @@ intel_create_image_from_texture(__DRIcontext *context, int target, image->dri_format = driGLFormatToImageFormat(image->format); image->has_depthstencil = iobj->mt->stencil_mt? true : false; image->planar_format = iobj->planar_format; - if (image->dri_format == MESA_FORMAT_NONE) { + if (image->dri_format == __DRI_IMAGE_FORMAT_NONE) { *error = __DRI_IMAGE_ERROR_BAD_PARAMETER; free(image); return NULL; |