drm/radeon/dpm: implement force performance levels for 7xx/eg/btc
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / radeon / radeon_cursor.c
index b097d5b4ff393daaa735d158a89aaea69f421a9f..9630e8d95fb40655df4ceefd18e5015ca47194c6 100644 (file)
@@ -27,9 +27,6 @@
 #include <drm/radeon_drm.h>
 #include "radeon.h"
 
-#define CURSOR_WIDTH 64
-#define CURSOR_HEIGHT 64
-
 static void radeon_lock_cursor(struct drm_crtc *crtc, bool lock)
 {
        struct radeon_device *rdev = crtc->dev->dev_private;
@@ -167,7 +164,8 @@ int radeon_crtc_cursor_set(struct drm_crtc *crtc,
                goto unpin;
        }
 
-       if ((width > CURSOR_WIDTH) || (height > CURSOR_HEIGHT)) {
+       if ((width > radeon_crtc->max_cursor_width) ||
+           (height > radeon_crtc->max_cursor_height)) {
                DRM_ERROR("bad cursor width or height %d x %d\n", width, height);
                return -EINVAL;
        }
@@ -233,11 +231,11 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
        DRM_DEBUG("x %d y %d c->x %d c->y %d\n", x, y, crtc->x, crtc->y);
 
        if (x < 0) {
-               xorigin = min(-x, CURSOR_WIDTH - 1);
+               xorigin = min(-x, radeon_crtc->max_cursor_width - 1);
                x = 0;
        }
        if (y < 0) {
-               yorigin = min(-y, CURSOR_HEIGHT - 1);
+               yorigin = min(-y, radeon_crtc->max_cursor_height - 1);
                y = 0;
        }