0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "core.h"
0023 #include "head.h"
0024
0025 #include <nvif/pushc37b.h>
0026
0027 #include <nvhw/class/clc57d.h>
0028
0029 static int
0030 corec57d_init(struct nv50_core *core)
0031 {
0032 struct nvif_push *push = core->chan.push;
0033 const u32 windows = 8;
0034 int ret, i;
0035
0036 if ((ret = PUSH_WAIT(push, 2 + windows * 5)))
0037 return ret;
0038
0039 PUSH_MTHD(push, NVC57D, SET_CONTEXT_DMA_NOTIFIER, core->chan.sync.handle);
0040
0041 for (i = 0; i < windows; i++) {
0042 PUSH_MTHD(push, NVC57D, WINDOW_SET_WINDOW_FORMAT_USAGE_BOUNDS(i),
0043 NVDEF(NVC57D, WINDOW_SET_WINDOW_FORMAT_USAGE_BOUNDS, RGB_PACKED1BPP, TRUE) |
0044 NVDEF(NVC57D, WINDOW_SET_WINDOW_FORMAT_USAGE_BOUNDS, RGB_PACKED2BPP, TRUE) |
0045 NVDEF(NVC57D, WINDOW_SET_WINDOW_FORMAT_USAGE_BOUNDS, RGB_PACKED4BPP, TRUE) |
0046 NVDEF(NVC57D, WINDOW_SET_WINDOW_FORMAT_USAGE_BOUNDS, RGB_PACKED8BPP, TRUE),
0047
0048 WINDOW_SET_WINDOW_ROTATED_FORMAT_USAGE_BOUNDS(i), 0x00000000);
0049
0050 PUSH_MTHD(push, NVC57D, WINDOW_SET_WINDOW_USAGE_BOUNDS(i),
0051 NVVAL(NVC57D, WINDOW_SET_WINDOW_USAGE_BOUNDS, MAX_PIXELS_FETCHED_PER_LINE, 0x7fff) |
0052 NVDEF(NVC57D, WINDOW_SET_WINDOW_USAGE_BOUNDS, ILUT_ALLOWED, TRUE) |
0053 NVDEF(NVC57D, WINDOW_SET_WINDOW_USAGE_BOUNDS, INPUT_SCALER_TAPS, TAPS_2) |
0054 NVDEF(NVC57D, WINDOW_SET_WINDOW_USAGE_BOUNDS, UPSCALING_ALLOWED, FALSE));
0055 }
0056
0057 core->assign_windows = true;
0058 return PUSH_KICK(push);
0059 }
0060
0061 static const struct nv50_core_func
0062 corec57d = {
0063 .init = corec57d_init,
0064 .ntfy_init = corec37d_ntfy_init,
0065 .caps_init = corec37d_caps_init,
0066 .ntfy_wait_done = corec37d_ntfy_wait_done,
0067 .update = corec37d_update,
0068 .wndw.owner = corec37d_wndw_owner,
0069 .head = &headc57d,
0070 .sor = &sorc37d,
0071 #if IS_ENABLED(CONFIG_DEBUG_FS)
0072 .crc = &crcc57d,
0073 #endif
0074 };
0075
0076 int
0077 corec57d_new(struct nouveau_drm *drm, s32 oclass, struct nv50_core **pcore)
0078 {
0079 return core507d_new_(&corec57d, drm, oclass, pcore);
0080 }