0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "curs.h"
0023 #include "atom.h"
0024
0025 #include <nvhw/class/clc37a.h>
0026
0027 static int
0028 cursc37a_update(struct nv50_wndw *wndw, u32 *interlock)
0029 {
0030 struct nvif_object *user = &wndw->wimm.base.user;
0031 int ret = nvif_chan_wait(&wndw->wimm, 1);
0032 if (ret == 0)
0033 NVIF_WR32(user, NVC37A, UPDATE, 0x00000001);
0034 return ret;
0035 }
0036
0037 static int
0038 cursc37a_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
0039 {
0040 struct nvif_object *user = &wndw->wimm.base.user;
0041 int ret = nvif_chan_wait(&wndw->wimm, 1);
0042 if (ret == 0) {
0043 NVIF_WR32(user, NVC37A, SET_CURSOR_HOT_SPOT_POINT_OUT(0),
0044 NVVAL(NVC37A, SET_CURSOR_HOT_SPOT_POINT_OUT, X, asyw->point.x) |
0045 NVVAL(NVC37A, SET_CURSOR_HOT_SPOT_POINT_OUT, Y, asyw->point.y));
0046 }
0047 return ret;
0048 }
0049
0050 static const struct nv50_wimm_func
0051 cursc37a = {
0052 .point = cursc37a_point,
0053 .update = cursc37a_update,
0054 };
0055
0056 int
0057 cursc37a_new(struct nouveau_drm *drm, int head, s32 oclass,
0058 struct nv50_wndw **pwndw)
0059 {
0060 return curs507a_new_(&cursc37a, drm, head, oclass,
0061 0x00000001 << head, pwndw);
0062 }