Re: [PATCH] drm/radeon/kms/blit: fix blit copy for very large buffers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mit, 2012-02-01 at 17:07 -0500, Ilija Hadzic wrote: 
> 
> diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c b/drivers/gpu/drm/radeon/r600_blit_kms.c
> index d996f43..32dcc95 100644
> --- a/drivers/gpu/drm/radeon/r600_blit_kms.c
> +++ b/drivers/gpu/drm/radeon/r600_blit_kms.c
> @@ -468,27 +468,42 @@ set_default_state(struct radeon_device *rdev)
>  	radeon_ring_write(ring, sq_stack_resource_mgmt_2);
>  }
>  
> +#define I2F_MAX_BITS 15
> +#define I2F_MAX_INPUT  ((2 << I2F_MAX_BITS) - 1)

Should be ((1 << I2F_MAX_BITS) - 1): 2^n == (1 << n)


> static uint32_t i2f(uint32_t input)
>  {
>  	u32 result, i, exponent, fraction;
>  
> -	if ((input & 0x3fff) == 0)
> -		result = 0; /* 0 is a special case */
> +	WARN_ON(input > I2F_MAX_INPUT);

Use WARN_ON_ONCE here to avoid spamming the kernel output. If this is
ever hit again, it won't happen just once.


Looks good to me otherwise.


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux