[Intel-gfx] xf86-video-intel: 5 commits - src/i830_accel.c src/i830_batchbuffer.c src/i830_dri.c src/i830_memory.c src/i830_uxa.c src/i965_hwmc.c uxa/uxa-accel.c uxa/uxa-unaccel.c

Eric Anholt eric at anholt.net
Thu Dec 3 22:13:26 CET 2009


On Wed,  2 Dec 2009 06:30:54 -0800 (PST), ickle at kemper.freedesktop.org (Chris Wilson) wrote:
> commit 6be26cae8379f973d9ca27e0d5371d16618e4f7b
> Author: Chris Wilson <chris at chris-wilson.co.uk>
> Date:   Tue Dec 1 16:13:25 2009 +0000
> 
>     i830: Simplify prepare_access / finish_access
>     
>     Reduce the 3 conditions into the 2 distinct cases. This has the
>     secondary benefit of also distinguishing between the reported errors.
>     
>     Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> 
> diff --git a/src/i830_uxa.c b/src/i830_uxa.c
> index 4d7ecb7..875833b 100644
> --- a/src/i830_uxa.c
> +++ b/src/i830_uxa.c
> @@ -38,6 +38,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
>  #include "i915_drm.h"
>  #include <string.h>
>  #include <sys/mman.h>
> +#include <errno.h>
>  
>  const int I830CopyROP[16] = {
>  	ROP_0,			/* GXclear */
> @@ -574,22 +575,24 @@ static Bool i830_uxa_prepare_access(PixmapPtr pixmap, uxa_access_t access)
>  		intel_batch_flush(scrn, TRUE);
>  
>  	/* No VT sema or GEM?  No GTT mapping. */
> -	if (!scrn->vtSema) {
> -		if (dri_bo_map(bo, access == UXA_ACCESS_RW) != 0)
> -			return FALSE;
> -	} else if (bo->size < intel->max_gtt_map_size) {
> -		if (drm_intel_gem_bo_map_gtt(bo)) {
> +	if (!scrn->vtSema || bo->size > intel->max_gtt_map_size) {
> +		if (dri_bo_map(bo, access == UXA_ACCESS_RW) != 0) {
>  			xf86DrvMsg(scrn->scrnIndex, X_WARNING,
> -				   "%s: bo map failed\n", __FUNCTION__);
> +				   "%s: bo map failed: %d [%s]\n",
> +				   __FUNCTION__,
> +				   errno, strerror(errno));
>  			return FALSE;
>  		}
>  	} else {
> -		if (dri_bo_map(bo, access == UXA_ACCESS_RW) != 0) {
> +		if (drm_intel_gem_bo_map_gtt(bo)) {
>  			xf86DrvMsg(scrn->scrnIndex, X_WARNING,
> -				   "%s: bo map failed\n", __FUNCTION__);
> +				   "%s: gtt bo map failed: %d [%s]\n",
> +				   __FUNCTION__,
> +				   errno, strerror(errno));
>  			return FALSE;
>  		}
>  	}

Actually, we shouldn't need the vtsema check now that we're KMS-only.
That would be part of fixing things to allow tiled pixmaps as well :)



More information about the Intel-gfx mailing list