0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "base.h"
0023
0024 #include <nvif/push507c.h>
0025
0026 #include <nvhw/class/cl827c.h>
0027
0028 static int
0029 base827c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
0030 {
0031 struct nvif_push *push = wndw->wndw.push;
0032 int ret;
0033
0034 if ((ret = PUSH_WAIT(push, 13)))
0035 return ret;
0036
0037 PUSH_MTHD(push, NV827C, SET_PRESENT_CONTROL,
0038 NVVAL(NV827C, SET_PRESENT_CONTROL, BEGIN_MODE, asyw->image.mode) |
0039 NVVAL(NV827C, SET_PRESENT_CONTROL, MIN_PRESENT_INTERVAL, asyw->image.interval));
0040
0041 PUSH_MTHD(push, NV827C, SET_CONTEXT_DMAS_ISO(0), asyw->image.handle, 1);
0042
0043 if (asyw->image.format == NV827C_SURFACE_SET_PARAMS_FORMAT_RF16_GF16_BF16_AF16) {
0044 PUSH_MTHD(push, NV827C, SET_PROCESSING,
0045 NVDEF(NV827C, SET_PROCESSING, USE_GAIN_OFS, ENABLE),
0046
0047 SET_CONVERSION,
0048 NVVAL(NV827C, SET_CONVERSION, GAIN, 0) |
0049 NVVAL(NV827C, SET_CONVERSION, OFS, 0x64));
0050 } else {
0051 PUSH_MTHD(push, NV827C, SET_PROCESSING,
0052 NVDEF(NV827C, SET_PROCESSING, USE_GAIN_OFS, DISABLE),
0053
0054 SET_CONVERSION,
0055 NVVAL(NV827C, SET_CONVERSION, GAIN, 0) |
0056 NVVAL(NV827C, SET_CONVERSION, OFS, 0));
0057 }
0058
0059 PUSH_MTHD(push, NV827C, SURFACE_SET_OFFSET(0, 0), asyw->image.offset[0] >> 8,
0060 SURFACE_SET_OFFSET(0, 1), 0x00000000,
0061
0062 SURFACE_SET_SIZE(0),
0063 NVVAL(NV827C, SURFACE_SET_SIZE, WIDTH, asyw->image.w) |
0064 NVVAL(NV827C, SURFACE_SET_SIZE, HEIGHT, asyw->image.h),
0065
0066 SURFACE_SET_STORAGE(0),
0067 NVVAL(NV827C, SURFACE_SET_STORAGE, BLOCK_HEIGHT, asyw->image.blockh) |
0068 NVVAL(NV827C, SURFACE_SET_STORAGE, PITCH, asyw->image.pitch[0] >> 8) |
0069 NVVAL(NV827C, SURFACE_SET_STORAGE, PITCH, asyw->image.blocks[0]) |
0070 NVVAL(NV827C, SURFACE_SET_STORAGE, MEMORY_LAYOUT, asyw->image.layout),
0071
0072 SURFACE_SET_PARAMS(0),
0073 NVVAL(NV827C, SURFACE_SET_PARAMS, FORMAT, asyw->image.format) |
0074 NVDEF(NV827C, SURFACE_SET_PARAMS, SUPER_SAMPLE, X1_AA) |
0075 NVDEF(NV827C, SURFACE_SET_PARAMS, GAMMA, LINEAR) |
0076 NVDEF(NV827C, SURFACE_SET_PARAMS, LAYOUT, FRM));
0077 return 0;
0078 }
0079
0080 static const struct nv50_wndw_func
0081 base827c = {
0082 .acquire = base507c_acquire,
0083 .release = base507c_release,
0084 .sema_set = base507c_sema_set,
0085 .sema_clr = base507c_sema_clr,
0086 .ntfy_reset = base507c_ntfy_reset,
0087 .ntfy_set = base507c_ntfy_set,
0088 .ntfy_clr = base507c_ntfy_clr,
0089 .ntfy_wait_begun = base507c_ntfy_wait_begun,
0090 .olut_core = 1,
0091 .xlut_set = base507c_xlut_set,
0092 .xlut_clr = base507c_xlut_clr,
0093 .image_set = base827c_image_set,
0094 .image_clr = base507c_image_clr,
0095 .update = base507c_update,
0096 };
0097
0098 int
0099 base827c_new(struct nouveau_drm *drm, int head, s32 oclass,
0100 struct nv50_wndw **pwndw)
0101 {
0102 return base507c_new_(&base827c, base507c_format, drm, head, oclass,
0103 0x00000002 << (head * 8), pwndw);
0104 }