提交 7d309529 编写于 作者: M Michel Dänzer 提交者: Dave Airlie

drm/radeon: Simplify cursor x/yorigin calculation.

Signed-off-by: NMichel Dänzer <michel.daenzer@amd.com>
Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 b356fe0a
...@@ -209,13 +209,9 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc, ...@@ -209,13 +209,9 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
int w = radeon_crtc->cursor_width; int w = radeon_crtc->cursor_width;
if (x < 0) if (x < 0)
xorigin = -x; xorigin = min(-x, CURSOR_WIDTH - 1);
if (y < 0) if (y < 0)
yorigin = -y; yorigin = min(-y, CURSOR_HEIGHT - 1);
if (xorigin >= CURSOR_WIDTH)
xorigin = CURSOR_WIDTH - 1;
if (yorigin >= CURSOR_HEIGHT)
yorigin = CURSOR_HEIGHT - 1;
if (ASIC_IS_AVIVO(rdev)) { if (ASIC_IS_AVIVO(rdev)) {
int i = 0; int i = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册