diff options
author | Ben Skeggs | 2018-12-11 05:50:02 +0100 |
---|---|---|
committer | Ben Skeggs | 2018-12-11 06:37:49 +0100 |
commit | cb55cd0c66a16fd965a44e2634755b060dc64bd7 (patch) | |
tree | 653f6a51b7d7894e17dd890f2b507f5df65ce5a2 /drivers/gpu/drm/nouveau/dispnv50/head907d.c | |
parent | drm/nouveau: remove left-over struct member (diff) | |
download | kernel-qcow2-linux-cb55cd0c66a16fd965a44e2634755b060dc64bd7.tar.gz kernel-qcow2-linux-cb55cd0c66a16fd965a44e2634755b060dc64bd7.tar.xz kernel-qcow2-linux-cb55cd0c66a16fd965a44e2634755b060dc64bd7.zip |
drm/nouveau/kms/nv50-: allow more flexibility with lut formats
Will be required for Turing.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/dispnv50/head907d.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/head907d.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/head907d.c b/drivers/gpu/drm/nouveau/dispnv50/head907d.c index 633907163eb1..c2d09dd97b1f 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head907d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head907d.c @@ -214,9 +214,27 @@ head907d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh) } void +head907d_olut_load(struct drm_color_lut *in, int size, void __iomem *mem) +{ + for (; size--; in++, mem += 8) { + writew(drm_color_lut_extract(in-> red, 14) + 0x6000, mem + 0); + writew(drm_color_lut_extract(in->green, 14) + 0x6000, mem + 2); + writew(drm_color_lut_extract(in-> blue, 14) + 0x6000, mem + 4); + } + + /* INTERPOLATE modes require a "next" entry to interpolate with, + * so we replicate the last entry to deal with this for now. + */ + writew(readw(mem - 8), mem + 0); + writew(readw(mem - 6), mem + 2); + writew(readw(mem - 4), mem + 4); +} + +void head907d_olut(struct nv50_head *head, struct nv50_head_atom *asyh) { asyh->olut.mode = 7; + asyh->olut.load = head907d_olut_load; } void |