[Mesa-dev] [PATCH v2 1/2] i965: Cleanup MapRangeBuffer

Eric Anholt eric at anholt.net
Thu Oct 6 14:17:03 PDT 2011


On Fri, 30 Sep 2011 20:59:39 -0700, Ben Widawsky <ben at bwidawsk.net> wrote:
> Clean the code up, and always use a BO when creating a new buffer. I've
> not seen any regressions but haven't yet tried this on < Gen6.

You have a bunch of different patches squashed into this here:

Replacing GL_TRUE/GL_FALSE with true/false.
Using a BO even for range-flushes
Rearranging logic.

Using a BO for range flushes is a definite behavior change that should
be separate from others and not hidden in a patch titled "i965: Cleanup
MapRangeBuffer".

> +   if (intel_obj->buffer == NULL)
> +      goto error_out;
> +
>     /* If the mapping is synchronized with other GL operations, flush
>      * the batchbuffer so that GEM knows about the buffer access for later
>      * syncing.
> @@ -322,11 +325,6 @@ intel_bufferobj_map_range(struct gl_context * ctx,
>         drm_intel_bo_references(intel->batch.bo, intel_obj->buffer))
>        intel_flush(ctx);
>  
> -   if (intel_obj->buffer == NULL) {
> -      obj->Pointer = NULL;
> -      return NULL;
> -   }
> -

I don't object to moving the code up, but making a goto for error case
used only once seems wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111006/626394d3/attachment-0001.pgp>


More information about the mesa-dev mailing list