drm/nouveau/kms/nv50-: use NVIDIA's headers for wimm point()

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
This commit is contained in:
Ben Skeggs 2020-06-21 10:25:58 +10:00
parent 2a0d40bbd6
commit 937014086a
4 changed files with 46 additions and 5 deletions

View File

@ -55,10 +55,12 @@ curs507a_update(struct nv50_wndw *wndw, u32 *interlock)
static int static int
curs507a_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) curs507a_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{ {
struct nvif_object *user = &wndw->wimm.base.user;
int ret = nvif_chan_wait(&wndw->wimm, 1); int ret = nvif_chan_wait(&wndw->wimm, 1);
if (ret == 0) { if (ret == 0) {
nvif_wr32(&wndw->wimm.base.user, 0x0084, asyw->point.y << 16 | NVIF_WR32(user, NV507A, SET_CURSOR_HOT_SPOT_POINT_OUT,
asyw->point.x); NVVAL(NV507A, SET_CURSOR_HOT_SPOT_POINT_OUT, X, asyw->point.x) |
NVVAL(NV507A, SET_CURSOR_HOT_SPOT_POINT_OUT, Y, asyw->point.y));
} }
return ret; return ret;
} }

View File

@ -22,6 +22,8 @@
#include "curs.h" #include "curs.h"
#include "atom.h" #include "atom.h"
#include <nvhw/class/clc37a.h>
static int static int
cursc37a_update(struct nv50_wndw *wndw, u32 *interlock) cursc37a_update(struct nv50_wndw *wndw, u32 *interlock)
{ {
@ -34,10 +36,12 @@ cursc37a_update(struct nv50_wndw *wndw, u32 *interlock)
static int static int
cursc37a_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) cursc37a_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{ {
struct nvif_object *user = &wndw->wimm.base.user;
int ret = nvif_chan_wait(&wndw->wimm, 1); int ret = nvif_chan_wait(&wndw->wimm, 1);
if (ret == 0) { if (ret == 0) {
nvif_wr32(&wndw->wimm.base.user, 0x0208, asyw->point.y << 16 | NVIF_WR32(user, NVC37A, SET_CURSOR_HOT_SPOT_POINT_OUT(0),
asyw->point.x); NVVAL(NVC37A, SET_CURSOR_HOT_SPOT_POINT_OUT, X, asyw->point.x) |
NVVAL(NVC37A, SET_CURSOR_HOT_SPOT_POINT_OUT, Y, asyw->point.y));
} }
return ret; return ret;
} }

View File

@ -26,6 +26,8 @@
#include <nvif/clc37b.h> #include <nvif/clc37b.h>
#include <nvif/pushc37b.h> #include <nvif/pushc37b.h>
#include <nvhw/class/clc37b.h>
static int static int
wimmc37b_update(struct nv50_wndw *wndw, u32 *interlock) wimmc37b_update(struct nv50_wndw *wndw, u32 *interlock)
{ {
@ -50,7 +52,9 @@ wimmc37b_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
if ((ret = PUSH_WAIT(push, 2))) if ((ret = PUSH_WAIT(push, 2)))
return ret; return ret;
PUSH_NVSQ(push, NVC37B, 0x0208, asyw->point.y << 16 | asyw->point.x); PUSH_MTHD(push, NVC37B, SET_POINT_OUT(0),
NVVAL(NVC37B, SET_POINT_OUT, X, asyw->point.x) |
NVVAL(NVC37B, SET_POINT_OUT, Y, asyw->point.y));
return 0; return 0;
} }

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 1993-2017, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef _clc37a__h_
#define _clc37a__h_
#define NVC37A_UPDATE (0x00000200)
#define NVC37A_SET_CURSOR_HOT_SPOT_POINT_OUT(b) (0x00000208 + (b)*0x00000004)
#define NVC37A_SET_CURSOR_HOT_SPOT_POINT_OUT_X 15:0
#define NVC37A_SET_CURSOR_HOT_SPOT_POINT_OUT_Y 31:16
#endif // _clc37a_h