Commit 6833d2a0 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/kms/nv50-: use NVIDIA's headers for wndw xlut_set()

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 2740edb3
...@@ -114,7 +114,8 @@ base507c_xlut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) ...@@ -114,7 +114,8 @@ base507c_xlut_set(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, NV507C, 0x00e0, 0x40000000); PUSH_MTHD(push, NV507C, SET_BASE_LUT_LO,
NVDEF(NV507C, SET_BASE_LUT_LO, ENABLE, USE_CORE_LUT));
return 0; return 0;
} }
......
...@@ -72,11 +72,16 @@ base907c_xlut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) ...@@ -72,11 +72,16 @@ base907c_xlut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
if ((ret = PUSH_WAIT(push, 6))) if ((ret = PUSH_WAIT(push, 6)))
return ret; return ret;
PUSH_NVSQ(push, NV907C, 0x00e0, asyw->xlut.i.enable << 30 | PUSH_MTHD(push, NV907C, SET_BASE_LUT_LO,
asyw->xlut.i.mode << 24, NVVAL(NV907C, SET_BASE_LUT_LO, ENABLE, asyw->xlut.i.enable) |
0x00e4, asyw->xlut.i.offset >> 8, NVVAL(NV907C, SET_BASE_LUT_LO, MODE, asyw->xlut.i.mode),
0x00e8, 0x40000000);
PUSH_NVSQ(push, NV907C, 0x00fc, asyw->xlut.handle); SET_BASE_LUT_HI, asyw->xlut.i.offset >> 8,
SET_OUTPUT_LUT_LO,
NVDEF(NV907C, SET_OUTPUT_LUT_LO, ENABLE, USE_CORE_LUT));
PUSH_MTHD(push, NV907C, SET_CONTEXT_DMA_LUT, asyw->xlut.handle);
return 0; return 0;
} }
...@@ -86,8 +91,12 @@ base907c_ilut(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, int size) ...@@ -86,8 +91,12 @@ base907c_ilut(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, int size)
if (size != 256 && size != 1024) if (size != 256 && size != 1024)
return false; return false;
asyw->xlut.i.mode = size == 1024 ? 4 : 7; if (size == 1024)
asyw->xlut.i.enable = 2; asyw->xlut.i.mode = NV907C_SET_BASE_LUT_LO_MODE_INTERPOLATE_1025_UNITY_RANGE;
else
asyw->xlut.i.mode = NV907C_SET_BASE_LUT_LO_MODE_INTERPOLATE_257_UNITY_RANGE;
asyw->xlut.i.enable = NV907C_SET_BASE_LUT_LO_ENABLE_ENABLE;
asyw->xlut.i.load = head907d_olut_load; asyw->xlut.i.load = head907d_olut_load;
return true; return true;
} }
......
...@@ -72,11 +72,13 @@ wndwc37e_ilut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) ...@@ -72,11 +72,13 @@ wndwc37e_ilut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
if ((ret = PUSH_WAIT(push, 4))) if ((ret = PUSH_WAIT(push, 4)))
return ret; return ret;
PUSH_NVSQ(push, NVC37E, 0x02b0, asyw->xlut.i.output_mode << 8 | PUSH_MTHD(push, NVC37E, SET_CONTROL_INPUT_LUT,
asyw->xlut.i.range << 4 | NVVAL(NVC37E, SET_CONTROL_INPUT_LUT, OUTPUT_MODE, asyw->xlut.i.output_mode) |
asyw->xlut.i.size, NVVAL(NVC37E, SET_CONTROL_INPUT_LUT, RANGE, asyw->xlut.i.range) |
0x02b4, asyw->xlut.i.offset >> 8, NVVAL(NVC37E, SET_CONTROL_INPUT_LUT, SIZE, asyw->xlut.i.size),
0x02b8, asyw->xlut.handle);
SET_OFFSET_INPUT_LUT, asyw->xlut.i.offset >> 8,
SET_CONTEXT_DMA_INPUT_LUT, asyw->xlut.handle);
return 0; return 0;
} }
...@@ -86,10 +88,10 @@ wndwc37e_ilut(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, int size) ...@@ -86,10 +88,10 @@ wndwc37e_ilut(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, int size)
if (size != 256 && size != 1024) if (size != 256 && size != 1024)
return false; return false;
asyw->xlut.i.mode = 2; asyw->xlut.i.size = size == 1024 ? NVC37E_SET_CONTROL_INPUT_LUT_SIZE_SIZE_1025 :
asyw->xlut.i.size = size == 1024 ? 2 : 0; NVC37E_SET_CONTROL_INPUT_LUT_SIZE_SIZE_257;
asyw->xlut.i.range = 0; asyw->xlut.i.range = NVC37E_SET_CONTROL_INPUT_LUT_RANGE_UNITY;
asyw->xlut.i.output_mode = 1; asyw->xlut.i.output_mode = NVC37E_SET_CONTROL_INPUT_LUT_OUTPUT_MODE_INTERPOLATE;
asyw->xlut.i.load = head907d_olut_load; asyw->xlut.i.load = head907d_olut_load;
return true; return true;
} }
......
...@@ -113,11 +113,13 @@ wndwc57e_ilut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) ...@@ -113,11 +113,13 @@ wndwc57e_ilut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
if ((ret = PUSH_WAIT(push, 4))) if ((ret = PUSH_WAIT(push, 4)))
return ret; return ret;
PUSH_NVSQ(push, NVC57E, 0x0440, asyw->xlut.i.size << 8 | PUSH_MTHD(push, NVC57E, SET_ILUT_CONTROL,
asyw->xlut.i.mode << 2 | NVVAL(NVC57E, SET_ILUT_CONTROL, SIZE, asyw->xlut.i.size) |
asyw->xlut.i.output_mode, NVVAL(NVC57E, SET_ILUT_CONTROL, MODE, asyw->xlut.i.mode) |
0x0444, asyw->xlut.handle, NVVAL(NVC57E, SET_ILUT_CONTROL, INTERPOLATE, asyw->xlut.i.output_mode),
0x0448, asyw->xlut.i.offset >> 8);
SET_CONTEXT_DMA_ILUT, asyw->xlut.handle,
SET_OFFSET_ILUT, asyw->xlut.i.offset >> 8);
return 0; return 0;
} }
...@@ -163,13 +165,13 @@ wndwc57e_ilut(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, int size) ...@@ -163,13 +165,13 @@ wndwc57e_ilut(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, int size)
if (size = size ? size : 1024, size != 256 && size != 1024) if (size = size ? size : 1024, size != 256 && size != 1024)
return false; return false;
if (size == 256) { if (size == 256)
asyw->xlut.i.mode = 1; /* DIRECT8. */ asyw->xlut.i.mode = NVC57E_SET_ILUT_CONTROL_MODE_DIRECT8;
} else { else
asyw->xlut.i.mode = 2; /* DIRECT10. */ asyw->xlut.i.mode = NVC57E_SET_ILUT_CONTROL_MODE_DIRECT10;
}
asyw->xlut.i.size = 4 /* VSS header. */ + size + 1 /* Entries. */; asyw->xlut.i.size = 4 /* VSS header. */ + size + 1 /* Entries. */;
asyw->xlut.i.output_mode = 0; /* INTERPOLATE_DISABLE. */ asyw->xlut.i.output_mode = NVC57E_SET_ILUT_CONTROL_INTERPOLATE_DISABLE;
asyw->xlut.i.load = wndwc57e_ilut_load; asyw->xlut.i.load = wndwc57e_ilut_load;
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment