diff options
author | Ilija Hadzic <ihadzic@research.bell-labs.com> | 2012-02-02 10:26:24 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-02-02 15:54:48 +0000 |
commit | 52b53a0bf8026a322cfa6cfec6a10dd31fef8752 (patch) | |
tree | d2247328b87baf65a3245be2ea7e430f14b2be95 /mm | |
parent | 304a48400d9718f74ec35ae46f30868a5f4c4516 (diff) | |
download | op-kernel-dev-52b53a0bf8026a322cfa6cfec6a10dd31fef8752.zip op-kernel-dev-52b53a0bf8026a322cfa6cfec6a10dd31fef8752.tar.gz |
drm/radeon/kms/blit: fix blit copy for very large buffers
Evergreen and NI blit copy was broken if the buffer maps to a rectangle
whose one dimension is 16384 (max dimension allowed by these chips).
In the mainline kernel, the problem is exposed only when buffers are
very large (1G), but it's still a problem. The problem could be exposed
for smaller buffers if anyone modifies the algorithm for rectangle
construction in r600_blit_create_rect() (the reason why someone would
modify that algorithm is to tune the performance of buffer moves).
The root cause was in i2f() function which only operated on range between
0 and 16383. Fix this by extending the range of i2f() function to 0 to
32767.
While at it improve the function so that the range can be easily
extended in the future (if it becomes necessary), cleanup lines
over 80 characters, and replace in-line comments with one strategic
comment that explains the crux of the function.
Credits to michel@daenzer.net for pointing out the root cause of
the bug.
v2: Fix I2F_MAX_INPUT constant definition goof and warn only once
if input argument is out of range. Edit the comment a little
bit to avoid some linguistic confusion and make it look better
in general.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions