diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2018-05-08 12:39:47 +0200 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2018-05-18 07:01:30 +0200 |
commit | 01d380ab4f702fffa6da60c4b006547b8dd66de8 (patch) | |
tree | 6f3d6916921b3205f8e9e0f2844d3cecd0430bf5 /drivers/gpu/drm/nouveau/dispnv50/curs507a.c | |
parent | drm/nouveau/kms/nv50-: separate blocklinear vs linear pitch (diff) | |
download | linux-01d380ab4f702fffa6da60c4b006547b8dd66de8.tar.xz linux-01d380ab4f702fffa6da60c4b006547b8dd66de8.zip |
drm/nouveau/kms/gk104-: support additional cursor sizes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/dispnv50/curs507a.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/curs507a.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/curs507a.c b/drivers/gpu/drm/nouveau/dispnv50/curs507a.c index ba05bcb13ae7..291c08117ab6 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/curs507a.c +++ b/drivers/gpu/drm/nouveau/dispnv50/curs507a.c @@ -21,6 +21,7 @@ */ #include "curs.h" #include "core.h" +#include "head.h" #include <nvif/cl507a.h> @@ -70,6 +71,7 @@ static int curs507a_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) { + struct nv50_head *head = nv50_head(asyw->state.crtc); int ret; ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, @@ -80,24 +82,14 @@ curs507a_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, if (ret || !asyh->curs.visible) return ret; - switch (asyw->state.fb->width) { - case 32: asyh->curs.layout = 0; break; - case 64: asyh->curs.layout = 1; break; - default: - return -EINVAL; - } - - if (asyw->state.fb->width != asyw->state.fb->height) + if (asyw->image.w != asyw->image.h) return -EINVAL; - switch (asyw->image.format) { - case 0xcf: asyh->curs.format = 1; break; - default: - WARN_ON(1); - return -EINVAL; - } + ret = head->func->curs_layout(head, asyw, asyh); + if (ret) + return ret; - return 0; + return head->func->curs_format(head, asyw, asyh); } static const u32 |