This source file includes following definitions.
- wimmc37b_update
- wimmc37b_point
- wimmc37b_init_
- wimmc37b_init
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 #include "wimm.h"
  23 #include "atom.h"
  24 #include "wndw.h"
  25 
  26 #include <nvif/clc37b.h>
  27 
  28 static void
  29 wimmc37b_update(struct nv50_wndw *wndw, u32 *interlock)
  30 {
  31         u32 *push;
  32         if ((push = evo_wait(&wndw->wimm, 2))) {
  33                 evo_mthd(push, 0x0200, 1);
  34                 if (interlock[NV50_DISP_INTERLOCK_WNDW] & wndw->interlock.data)
  35                         evo_data(push, 0x00000003);
  36                 else
  37                         evo_data(push, 0x00000001);
  38                 evo_kick(push, &wndw->wimm);
  39         }
  40 }
  41 
  42 static void
  43 wimmc37b_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
  44 {
  45         u32 *push;
  46         if ((push = evo_wait(&wndw->wimm, 2))) {
  47                 evo_mthd(push, 0x0208, 1);
  48                 evo_data(push, asyw->point.y << 16 | asyw->point.x);
  49                 evo_kick(push, &wndw->wimm);
  50         }
  51 }
  52 
  53 static const struct nv50_wimm_func
  54 wimmc37b = {
  55         .point = wimmc37b_point,
  56         .update = wimmc37b_update,
  57 };
  58 
  59 static int
  60 wimmc37b_init_(const struct nv50_wimm_func *func, struct nouveau_drm *drm,
  61                s32 oclass, struct nv50_wndw *wndw)
  62 {
  63         struct nvc37b_window_imm_channel_dma_v0 args = {
  64                 .pushbuf = 0xb0007b00 | wndw->id,
  65                 .index = wndw->id,
  66         };
  67         struct nv50_disp *disp = nv50_disp(drm->dev);
  68         int ret;
  69 
  70         ret = nv50_dmac_create(&drm->client.device, &disp->disp->object,
  71                                &oclass, 0, &args, sizeof(args), 0,
  72                                &wndw->wimm);
  73         if (ret) {
  74                 NV_ERROR(drm, "wimm%04x allocation failed: %d\n", oclass, ret);
  75                 return ret;
  76         }
  77 
  78         wndw->interlock.wimm = wndw->interlock.data;
  79         wndw->immd = func;
  80         return 0;
  81 }
  82 
  83 int
  84 wimmc37b_init(struct nouveau_drm *drm, s32 oclass, struct nv50_wndw *wndw)
  85 {
  86         return wimmc37b_init_(&wimmc37b, drm, oclass, wndw);
  87 }