drm: Add plane color matrix on rockchip
Subsystems (4)
cover drm: Add plane color matrix on rockchip
Hello,
this patch series adds a per plane color matrix property as well as an implementation for rockchip.
This patch series builds on and includes previous work done by uma.shankar:
https://lists.freedesktop.org/archives/dri-devel/2017-September/153347.html
The first rockchip patch of this series sets a BT.601 color conversion matrix for YUV formats and is included because it adds YUV2YUV registers that the rest of the color matrix rockchip implementation depends upon.
The next patches are the ones originally provided by uma.shankar, rebased and containing an additional small fix.
The final set of rockchip patches implement, and finally enable, the plane CTM property on rockchip.
These patches have been rebased on drm-next (80daf42f97b1a0503d029f3c1325), Unfortunately I haven't been able to test them after rebasing because the display doesn't come up when I push a kernel built from drm-next on a device.
Daniele Castagna (5):
drm/rockchip: YUV overlays BT.601 color conversion. drm/rockchip: Add yuv2yuv registers to vop_lit drm/rockchip: Add R2R registers drm/rockchip: Implement drm plane->ctm property. drm/rockchip: Enable 'PLANE_CTM' drm property.
uma.shankar at intel.com (Uma Shankar) (5):
drm: Add Plane Degamma properties
drm: Add Plane CTM property
drm: Add Plane Gamma properties
drm: Define helper function for plane color enabling
drm: Define helper to set legacy gamma table size
drivers/gpu/drm/drm_atomic.c | 30 +++++++ drivers/gpu/drm/drm_atomic_helper.c | 14 ++++ drivers/gpu/drm/drm_color_mgmt.c | 41 ++++++++++ drivers/gpu/drm/drm_mode_config.c | 34 ++++++++ drivers/gpu/drm/drm_plane.c | 48 +++++++++++ drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 90 ++++++++++++++++++++- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 16 ++++ drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 88 +++++++++++++++++++- include/drm/drm_color_mgmt.h | 8 ++ include/drm/drm_mode_config.h | 27 +++++++ include/drm/drm_plane.h | 31 +++++++ 11 files changed, 424 insertions(+), 3 deletions(-)
Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/10 drm/rockchip: YUV overlays BT.601 color conversion.
Currently NV12 hardware overlays scheduled with atomic interface are converted to RGB using a color space conversion different than BT.601.
The result is that colors of NV12 buffers composited with Mali don't match colors of YUV hardware overlays.
Running modetest with an NV12 plane also shows colors are incorrect if compared to an RGB overlay that represents the same color pattern.
This CL adds support for YUV2YUV color space conversion (CSC) module on rockchip and enables the YUV2RGB part that allows to specify a 4x3 matrix to convert the colors.
The matrix is set to BT.601 coefficients to align to Mali and to what modetest expects.
TEST=modetest -M rockchip -s 34@30:2400x1600 -P 30:640x480+650+10@NV12 -P 30:640x480+10+10@XR24
--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 40 ++++++++++++++++++++- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 9 +++++ drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 39 ++++++++++++++++++-- 3 files changed, 85 insertions(+), 3 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +39 -1
@@ -50,6 +50,10 @@ vop_reg_set(vop, &win->phy->scl->ext->name, \ win->base, ~0, v, #name) +#define VOP_YUV2YUV_SET(x, name, v) \ + if ((x)->data->yuv2yuv) \ + vop_reg_set(vop, &vop->data->yuv2yuv->name, 0, ~0, v, #name) + #define VOP_INTR_SET_MASK(vop, name, mask, v) \ vop_reg_set(vop, &vop->data->intr->name, 0, mask, v, #name)
@@ -79,6 +83,18 @@#define to_vop (x) container_of(x, struct vop, crtc)#define to_vop_win (x) container_of(x, struct vop_win, base) +/* +* The coefficients of the following matrix are all fixed points. +* The format is S2.10 for the 3x3 part of the matrix, and S9.12 for the offsets. +* They are all represented in two's complement. +*/ +static const uint32_t bt601_yuv2rgb[] = { +0x4A8 ,0x0 ,0x662 , +0x4A8 ,0x1E6F ,0x1CBF , +0x4A8 ,0x812 ,0x0 , +0x321168 ,0x0877CF ,0x2EB127 +}; +enum vop_pending {VOP_PENDING_FB_UNREF , };
@@ -722,6 +738,9 @@ static void vop_plane_atomic_update(struct drm_plane *plane,uint32_t val;bool rb_swap;int format; +int is_yuv =is_yuv_support (fb->format->format); +int win_index =VOP_WIN_TO_INDEX (vop_win); +int i;/* * can't update plane when vop is disabled.
@@ -762,7 +781,14 @@ static void vop_plane_atomic_update(struct drm_plane *plane,VOP_WIN_SET (vop, win, format, format);VOP_WIN_SET (vop, win, yrgb_vir,DIV_ROUND_UP (fb->pitches[0 ],4 ));VOP_WIN_SET (vop, win, yrgb_mst, dma_addr); -if (is_yuv_support (fb->format->format)) { + +if (!win_index) { +VOP_YUV2YUV_SET (vop, win0_y2r_en, is_yuv); + }else if (win_index ==1 ) { +VOP_YUV2YUV_SET (vop, win1_y2r_en, is_yuv); + } + +if (is_yuv) {int hsub =drm_format_horz_chroma_subsampling (fb->format->format);int vsub =drm_format_vert_chroma_subsampling (fb->format->format);int bpp = fb->format->cpp[1 ];
@@ -776,6 +802,18 @@ static void vop_plane_atomic_update(struct drm_plane *plane, dma_addr = rk_uv_obj->dma_addr + offset + fb->offsets[1 ];VOP_WIN_SET (vop, win, uv_vir,DIV_ROUND_UP (fb->pitches[1 ],4 ));VOP_WIN_SET (vop, win, uv_mst, dma_addr); + +for (i =0 ; i <12 ; i++) { +if (!win_index) { +VOP_YUV2YUV_SET (vop, + win0_y2r_coefficients[i], + bt601_yuv2rgb[i]); + }else { +VOP_YUV2YUV_SET (vop, + win1_y2r_coefficients[i], + bt601_yuv2rgb[i]); + } + } }if (win->phy->scl)
drivers/gpu/drm/rockchip/rockchip_drm_vop.h +9 -0
@@ -79,6 +79,14 @@ struct vop_misc {struct vop_reg global_regdone_en; }; +struct vop_yuv2yuv { +struct vop_reg win0_y2r_en; +struct vop_reg win0_y2r_coefficients[12 ]; + +struct vop_reg win1_y2r_en; +struct vop_reg win1_y2r_coefficients[12 ]; +}; +struct vop_intr {const int *intrs;uint32_t nintrs;
@@ -157,6 +165,7 @@ struct vop_data {const struct vop_misc *misc;const struct vop_modeset *modeset;const struct vop_output *output; +const struct vop_yuv2yuv *yuv2yuv;const struct vop_win_data *win;unsigned int win_size;
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +37 -2
@@ -422,6 +422,40 @@ static const struct vop_output rk3399_output = { .mipi_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 15), }; +static const struct vop_yuv2yuv rk3399_vop_yuv2yuv = { + .win0_y2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,1 ), + .win0_y2r_coefficients = { +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +0 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +0 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +4 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +4 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +8 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +8 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +12 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +12 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +16 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +20 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +24 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +28 ,0xffffffff ,0 ), + }, + + .win1_y2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,9 ), + .win1_y2r_coefficients = { +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +0 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +0 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +4 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +4 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +8 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +8 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +12 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +12 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +16 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +20 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +24 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +28 ,0xffffffff ,0 ), + }, +}; +static const struct vop_data rk3399_vop_big = { .version =VOP_VERSION (3 ,5 ), .feature =VOP_FEATURE_OUTPUT_RGB10 ,
@@ -430,8 +464,9 @@ static const struct vop_data rk3399_vop_big = { .modeset = &rk3288_modeset, .output = &rk3399_output, .misc = &rk3368_misc, - .win = rk3368_vop_win_data, - .win_size = ARRAY_SIZE(rk3368_vop_win_data), + .yuv2yuv = &rk3399_vop_yuv2yuv, + .win = rk3399_vop_win_data, + .win_size = ARRAY_SIZE(rk3399_vop_win_data), };static const struct vop_win_data rk3399_vop_lit_win_data[] = {
Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
kbuild test robot
build botRe: [PATCH 01/10] drm/rockchip: YUV overlays BT.601 color conversion.
Thank you for the patch! Yet something to improve:
Hi Daniele,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on rockchip/for-next]
[also build test ERROR on v4.16-rc1 next-20180216]
[cannot apply to drm/drm-next]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Daniele-Castagna/drm-rockchip-YUV-overlays-BT-601-color-conversion/20180216-233006 base: https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next config: arm64-defconfig (attached as .config) compiler: aarch64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm64
All error/warnings (new ones prefixed by >>):
drivers/gpu//drm/rockchip/rockchip_drm_vop.c: In function 'vop_plane_atomic_update':
>> drivers/gpu//drm/rockchip/rockchip_drm_vop.c:742:18: error: implicit declaration of function 'VOP_WIN_TO_INDEX'; did you mean 'CAP_TO_INDEX'? [-Werror=implicit-function-declaration]
int win_index = VOP_WIN_TO_INDEX(vop_win);
^~~~~~~~~~~~~~~~
CAP_TO_INDEX
cc1: some warnings being treated as errors
--
>> drivers/gpu//drm/rockchip/rockchip_vop_reg.c:468:9: error: 'rk3399_vop_win_data' undeclared here (not in a function); did you mean 'rk3368_vop_win_data'?
.win = rk3399_vop_win_data,
^~~~~~~~~~~~~~~~~~~
rk3368_vop_win_data
In file included from arch/arm64/include/asm/sysreg.h:669:0,
from arch/arm64/include/asm/cputype.h:116,
from arch/arm64/include/asm/cache.h:19,
from include/linux/cache.h:6,
from include/linux/printk.h:9,
from include/linux/kernel.h:14,
from include/linux/list.h:9,
from include/linux/agp_backend.h:33,
from include/drm/drmP.h:35,
from drivers/gpu//drm/rockchip/rockchip_vop_reg.c:15:
>> include/linux/build_bug.h:29:45: error: bit-field '<anonymous>' width not an integer constant
#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); }))
^
include/linux/compiler-gcc.h:65:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
^~~~~~~~~~~~~~~~~
include/linux/kernel.h:71:59: note: in expansion of macro '__must_be_array'
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
^~~~~~~~~~~~~~~
>> drivers/gpu//drm/rockchip/rockchip_vop_reg.c:469:14: note: in expansion of macro 'ARRAY_SIZE'
.win_size = ARRAY_SIZE(rk3399_vop_win_data),
^~~~~~~~~~
--
drivers/gpu/drm/rockchip/rockchip_vop_reg.c:468:9: error: 'rk3399_vop_win_data' undeclared here (not in a function); did you mean 'rk3368_vop_win_data'?
.win = rk3399_vop_win_data,
^~~~~~~~~~~~~~~~~~~
rk3368_vop_win_data
In file included from arch/arm64/include/asm/sysreg.h:669:0,
from arch/arm64/include/asm/cputype.h:116,
from arch/arm64/include/asm/cache.h:19,
from include/linux/cache.h:6,
from include/linux/printk.h:9,
from include/linux/kernel.h:14,
from include/linux/list.h:9,
from include/linux/agp_backend.h:33,
from include/drm/drmP.h:35,
from drivers/gpu/drm/rockchip/rockchip_vop_reg.c:15:
>> include/linux/build_bug.h:29:45: error: bit-field '<anonymous>' width not an integer constant
#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); }))
^
include/linux/compiler-gcc.h:65:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
^~~~~~~~~~~~~~~~~
include/linux/kernel.h:71:59: note: in expansion of macro '__must_be_array'
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
^~~~~~~~~~~~~~~
drivers/gpu/drm/rockchip/rockchip_vop_reg.c:469:14: note: in expansion of macro 'ARRAY_SIZE'
.win_size = ARRAY_SIZE(rk3399_vop_win_data),
^~~~~~~~~~vim +742 drivers/gpu//drm/rockchip/rockchip_drm_vop.c
719
720 static void vop_plane_atomic_update(struct drm_plane *plane,
721 struct drm_plane_state *old_state)
722 {
723 struct drm_plane_state *state = plane->state;
724 struct drm_crtc *crtc = state->crtc;
725 struct vop_win *vop_win = to_vop_win(plane);
726 const struct vop_win_data *win = vop_win->data;
727 struct vop *vop = to_vop(state->crtc);
728 struct drm_framebuffer *fb = state->fb;
729 unsigned int actual_w, actual_h;
730 unsigned int dsp_stx, dsp_sty;
731 uint32_t act_info, dsp_info, dsp_st;
732 struct drm_rect *src = &state->src;
733 struct drm_rect *dest = &state->dst;
734 struct drm_gem_object *obj, *uv_obj;
735 struct rockchip_gem_object *rk_obj, *rk_uv_obj;
736 unsigned long offset;
737 dma_addr_t dma_addr;
738 uint32_t val;
739 bool rb_swap;
740 int format;
741 int is_yuv = is_yuv_support(fb->format->format);
> 742 int win_index = VOP_WIN_TO_INDEX(vop_win);
743 int i;
744
745 /*
746 * can't update plane when vop is disabled.
747 */
748 if (WARN_ON(!crtc))
749 return;
750
751 if (WARN_ON(!vop->is_enabled))
752 return;
753
754 if (!state->visible) {
755 vop_plane_atomic_disable(plane, old_state);
756 return;
757 }
758
759 obj = rockchip_fb_get_gem_obj(fb, 0);
760 rk_obj = to_rockchip_obj(obj);
761
762 actual_w = drm_rect_width(src) >> 16;
763 actual_h = drm_rect_height(src) >> 16;
764 act_info = (actual_h - 1) << 16 | ((actual_w - 1) & 0xffff);
765
766 dsp_info = (drm_rect_height(dest) - 1) << 16;
767 dsp_info |= (drm_rect_width(dest) - 1) & 0xffff;
768
769 dsp_stx = dest->x1 + crtc->mode.htotal - crtc->mode.hsync_start;
770 dsp_sty = dest->y1 + crtc->mode.vtotal - crtc->mode.vsync_start;
771 dsp_st = dsp_sty << 16 | (dsp_stx & 0xffff);
772
773 offset = (src->x1 >> 16) * fb->format->cpp[0];
774 offset += (src->y1 >> 16) * fb->pitches[0];
775 dma_addr = rk_obj->dma_addr + offset + fb->offsets[0];
776
777 format = vop_convert_format(fb->format->format);
778
779 spin_lock(&vop->reg_lock);
780
781 VOP_WIN_SET(vop, win, format, format);
782 VOP_WIN_SET(vop, win, yrgb_vir, DIV_ROUND_UP(fb->pitches[0], 4));
783 VOP_WIN_SET(vop, win, yrgb_mst, dma_addr);
784
785 if (!win_index) {
786 VOP_YUV2YUV_SET(vop, win0_y2r_en, is_yuv);
787 } else if (win_index == 1) {
788 VOP_YUV2YUV_SET(vop, win1_y2r_en, is_yuv);
789 }
790
791 if (is_yuv) {
792 int hsub = drm_format_horz_chroma_subsampling(fb->format->format);
793 int vsub = drm_format_vert_chroma_subsampling(fb->format->format);
794 int bpp = fb->format->cpp[1];
795
796 uv_obj = rockchip_fb_get_gem_obj(fb, 1);
797 rk_uv_obj = to_rockchip_obj(uv_obj);
798
799 offset = (src->x1 >> 16) * bpp / hsub;
800 offset += (src->y1 >> 16) * fb->pitches[1] / vsub;
801
802 dma_addr = rk_uv_obj->dma_addr + offset + fb->offsets[1];
803 VOP_WIN_SET(vop, win, uv_vir, DIV_ROUND_UP(fb->pitches[1], 4));
804 VOP_WIN_SET(vop, win, uv_mst, dma_addr);
805
806 for (i = 0; i < 12; i++) {
807 if (!win_index) {
808 VOP_YUV2YUV_SET(vop,
809 win0_y2r_coefficients[i],
810 bt601_yuv2rgb[i]);
811 } else {
812 VOP_YUV2YUV_SET(vop,
813 win1_y2r_coefficients[i],
814 bt601_yuv2rgb[i]);
815 }
816 }
817 }
818
819 if (win->phy->scl)
820 scl_vop_cal_scl_fac(vop, win, actual_w, actual_h,
821 drm_rect_width(dest), drm_rect_height(dest),
822 fb->format->format);
823
824 VOP_WIN_SET(vop, win, act_info, act_info);
825 VOP_WIN_SET(vop, win, dsp_info, dsp_info);
826 VOP_WIN_SET(vop, win, dsp_st, dsp_st);
827
828 rb_swap = has_rb_swapped(fb->format->format);
829 VOP_WIN_SET(vop, win, rb_swap, rb_swap);
830
831 if (is_alpha_support(fb->format->format)) {
832 VOP_WIN_SET(vop, win, dst_alpha_ctl,
833 DST_FACTOR_M0(ALPHA_SRC_INVERSE));
834 val = SRC_ALPHA_EN(1) | SRC_COLOR_M0(ALPHA_SRC_PRE_MUL) |
835 SRC_ALPHA_M0(ALPHA_STRAIGHT) |
836 SRC_BLEND_M0(ALPHA_PER_PIX) |
837 SRC_ALPHA_CAL_M0(ALPHA_NO_SATURATION) |
838 SRC_FACTOR_M0(ALPHA_ONE);
839 VOP_WIN_SET(vop, win, src_alpha_ctl, val);
840 } else {
841 VOP_WIN_SET(vop, win, src_alpha_ctl, SRC_ALPHA_EN(0));
842 }
843
844 VOP_WIN_SET(vop, win, enable, 1);
845 spin_unlock(&vop->reg_lock);
846 }
847
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 01/10] drm/rockchip: YUV overlays BT.601 color conversion.
In reply to Daniele CastagnaQuoted 9 lines · Daniele Castagna
Currently NV12 hardware overlays scheduled with atomic interface are converted to RGB using a color space conversion different than BT.601.
The result is that colors of NV12 buffers composited with Mali don't match colors of YUV hardware overlays.
Running modetest with an NV12 plane also shows colors are incorrect if compared to an RGB overlay that represents the same color pattern.
Quoted 6 lines
This CL adds support for YUV2YUV color space conversion (CSC) module on rockchip and enables the YUV2RGB part that allows to specify a 4x3 matrix to convert the colors.
The matrix is set to BT.601 coefficients to align to Mali and to what modetest expects.
Hey Daniele,
Apologies for missing this set.
Quoted 4 lines
TEST=modetest -M rockchip -s 34@30:2400x1600 -P 30:640x480+650+10@NV12 -P 30:640x480+10+10@XR24
Change-Id: Ia5a3b4793229e2c63f79f9f414d1cbe6ccc63fc1
It's usually good form to strip out the gerrit Change-Id from the commit message.
Quoted 93 lines
Tested-by Daniele Castagna <[email protected]>Reviewed-by Daniele Castagna <[email protected]>Reviewed-by Kristian H. Kristensen <[email protected]>--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 40 ++++++++++++++++++++- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 9 +++++ drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 39 ++++++++++++++++++-- 3 files changed, 85 insertions(+), 3 deletions(-)drivers/gpu/drm/rockchip/rockchip_drm_vop.c +39
-1@@ -50,6 +50,10 @@ vop_reg_set(vop, &win->phy->scl->ext->name, \ win->base, ~0, v, #name) +#define VOP_YUV2YUV_SET(x, name, v) \ + if ((x)->data->yuv2yuv) \ + vop_reg_set(vop, &vop->data->yuv2yuv->name, 0, ~0, v, #name) + #define VOP_INTR_SET_MASK(vop, name, mask, v) \ vop_reg_set(vop, &vop->data->intr->name, 0, mask, v, #name)@@ -79,6 +83,18 @@#define to_vop (x) container_of(x, struct vop, crtc)#define to_vop_win (x) container_of(x, struct vop_win, base) +/* +* The coefficients of the following matrix are all fixed points. +* The format is S2.10 for the 3x3 part of the matrix, and S9.12 for the offsets. +* They are all represented in two's complement. +*/ +static const uint32_t bt601_yuv2rgb[] = { +0x4A8 ,0x0 ,0x662 , +0x4A8 ,0x1E6F ,0x1CBF , +0x4A8 ,0x812 ,0x0 , +0x321168 ,0x0877CF ,0x2EB127 +}; +enum vop_pending {VOP_PENDING_FB_UNREF , };@@ -722,6 +738,9 @@ static void vop_plane_atomic_update(struct drm_plane *plane,uint32_t val;bool rb_swap;int format; +int is_yuv =is_yuv_support (fb->format->format); +int win_index =VOP_WIN_TO_INDEX (vop_win); +int i;/* * can't update plane when vop is disabled. @@ -762,7 +781,14 @@ static void vop_plane_atomic_update(struct drm_plane *plane,VOP_WIN_SET (vop, win, format, format);VOP_WIN_SET (vop, win, yrgb_vir,DIV_ROUND_UP (fb->pitches[0 ],4 ));VOP_WIN_SET (vop, win, yrgb_mst, dma_addr); -if (is_yuv_support (fb->format->format)) { + +if (!win_index) { +VOP_YUV2YUV_SET (vop, win0_y2r_en, is_yuv); + }else if (win_index ==1 ) { +VOP_YUV2YUV_SET (vop, win1_y2r_en, is_yuv); + } + +if (is_yuv) {int hsub =drm_format_horz_chroma_subsampling (fb->format->format);int vsub =drm_format_vert_chroma_subsampling (fb->format->format);int bpp = fb->format->cpp[1 ];@@ -776,6 +802,18 @@ static void vop_plane_atomic_update(struct drm_plane *plane, dma_addr = rk_uv_obj->dma_addr + offset + fb->offsets[1 ];VOP_WIN_SET (vop, win, uv_vir,DIV_ROUND_UP (fb->pitches[1 ],4 ));VOP_WIN_SET (vop, win, uv_mst, dma_addr); + +for (i =0 ; i <12 ; i++) { +if (!win_index) { +VOP_YUV2YUV_SET (vop, + win0_y2r_coefficients[i], + bt601_yuv2rgb[i]); + }else { +VOP_YUV2YUV_SET (vop, + win1_y2r_coefficients[i], + bt601_yuv2rgb[i]); + } + } }if (win->phy->scl)drivers/gpu/drm/rockchip/rockchip_drm_vop.h +0
-0
drivers/gpu/drm/rockchip/rockchip_drm_vop.h struct vop_misc { · line 88
Quoted 10 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.h +7
-0@@ -79,6 +79,14 @@ struct vop_misc {struct vop_reg global_regdone_en; }; +struct vop_yuv2yuv { +struct vop_reg win0_y2r_en; +struct vop_reg win0_y2r_coefficients[12 ]; + +struct vop_reg win1_y2r_en; +struct vop_reg win1_y2r_coefficients[12 ]; +};
struct vop_yuv2yuv {
struct {
struct vop_reg y2r_en;
struct vop_reg y2r_coefficients[12];
} regs[2];
};Then add win_index to the macro above and you can avoid the if (!win_index) checks everywhere.
Bonus points if you #define the '2' and '12' as something more meaningful
Quoted 76 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.h +2
-0+struct vop_intr {const int *intrs;uint32_t nintrs;@@ -157,6 +165,7 @@ struct vop_data {const struct vop_misc *misc;const struct vop_modeset *modeset;const struct vop_output *output; +const struct vop_yuv2yuv *yuv2yuv;const struct vop_win_data *win;unsigned int win_size;drivers/gpu/drm/rockchip/rockchip_vop_reg.c +37
-2@@ -422,6 +422,40 @@ static const struct vop_output rk3399_output = { .mipi_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 15), }; +static const struct vop_yuv2yuv rk3399_vop_yuv2yuv = { + .win0_y2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,1 ), + .win0_y2r_coefficients = { +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +0 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +0 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +4 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +4 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +8 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +8 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +12 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +12 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +16 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +20 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +24 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +28 ,0xffffffff ,0 ), + }, + + .win1_y2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,9 ), + .win1_y2r_coefficients = { +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +0 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +0 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +4 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +4 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +8 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +8 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +12 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +12 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +16 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +20 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +24 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +28 ,0xffffffff ,0 ), + }, +}; +static const struct vop_data rk3399_vop_big = { .version =VOP_VERSION (3 ,5 ), .feature =VOP_FEATURE_OUTPUT_RGB10 ,@@ -430,8 +464,9 @@ static const struct vop_data rk3399_vop_big = { .modeset = &rk3288_modeset, .output = &rk3399_output, .misc = &rk3368_misc, - .win = rk3368_vop_win_data, - .win_size = ARRAY_SIZE(rk3368_vop_win_data), + .yuv2yuv = &rk3399_vop_yuv2yuv, + .win = rk3399_vop_win_data, + .win_size = ARRAY_SIZE(rk3399_vop_win_data), };static const struct vop_win_data rk3399_vop_lit_win_data[] = {Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 1/1 drm/rockchip: Fix YUV buffers color rendering
In reply to Daniele CastagnaFrom: Daniele Castagna <[email protected]>
Currently, YUV hardware overlays are converted to RGB using a color space conversion different than BT.601.
The result is that colors of e.g. NV12 buffers don't match colors of YUV hardware overlays.
In order to fix this, enable YUV2YUV and set appropriate coefficients for formats such as NV12 to be displayed correctly.
This commit was tested using modetest, gstreamer and chromeos (hardware accelerated video playback). Before the commit, tests rendering with NV12 format resulted in colors not displayed correctly.
Test examples (RK3399 Ficus board connected to HDMI monitor):
$ modetest 39@32:1920x1080@NV12 $ gst-launch-1.0 videotestrc ! video/x-raw,format=NV12 ! kmssink
---
v2:
* Addressed feedback from Sean Paul
* Rebased on linux-next
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 41 ++++++++++++++++++++- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 13 +++++++ drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 36 ++++++++++++++++++ 3 files changed, 89 insertions(+), 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +40 -1
@@ -52,6 +52,18 @@ vop_reg_set(vop, &win->phy->scl->ext->name, \ win->base, ~0, v, #name) +#define VOP_WIN_YUV2YUV_SET(x, win_yuv2yuv, name, v) \ + do { \ + if (win_yuv2yuv->name.mask) \ + vop_reg_set(vop, &win_yuv2yuv->name, 0, ~0, v, #name); \ + } while (0) + +#define VOP_WIN_YUV2YUV_COEFFICIENT_SET(x, win_yuv2yuv, name, v) \ + do { \ + if (win_yuv2yuv->phy->name.mask) \ + vop_reg_set(vop, &win_yuv2yuv->phy->name, win_yuv2yuv->base, ~0, v, #name); \ + } while (0) + #define VOP_INTR_SET_MASK(vop, name, mask, v) \ vop_reg_set(vop, &vop->data->intr->name, 0, mask, v, #name)
@@ -84,6 +96,18 @@#define to_vop (x) container_of(x, struct vop, crtc)#define to_vop_win (x) container_of(x, struct vop_win, base) +/* +* The coefficients of the following matrix are all fixed points. +* The format is S2.10 for the 3x3 part of the matrix, and S9.12 for the offsets. +* They are all represented in two's complement. +*/ +static const uint32_t rockchip_bt601_yuv2rgb[] = { +0x000004a8 ,0x00000000 ,0x00000662 , +0x000004a8 ,0x00001e6f ,0x00001cbf , +0x000004a8 ,0x00000812 ,0x00000000 , +0x00321168 ,0x000877cf ,0x002eb127 +}; +enum vop_pending {VOP_PENDING_FB_UNREF , };
@@ -91,6 +115,7 @@ enum vop_pending {struct vop_win {struct drm_plane base;const struct vop_win_data *data; +const struct vop_win_yuv2yuv_data *yuv2yuv_data;struct vop *vop; };
@@ -712,6 +737,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,struct drm_crtc *crtc = state->crtc;struct vop_win *vop_win =to_vop_win (plane);const struct vop_win_data *win = vop_win->data; +const struct vop_win_yuv2yuv_data *win_yuv2yuv = vop_win->yuv2yuv_data;struct vop *vop =to_vop (state->crtc);struct drm_framebuffer *fb = state->fb;unsigned int actual_w, actual_h;
@@ -727,6 +753,8 @@ static void vop_plane_atomic_update(struct drm_plane *plane,bool rb_swap;int win_index =VOP_WIN_TO_INDEX (vop_win);int format; +int is_yuv = fb->format->is_yuv; +int i;/* * can't update plane when vop is disabled.
@@ -767,7 +795,10 @@ static void vop_plane_atomic_update(struct drm_plane *plane,VOP_WIN_SET (vop, win, format, format);VOP_WIN_SET (vop, win, yrgb_vir,DIV_ROUND_UP (fb->pitches[0 ],4 ));VOP_WIN_SET (vop, win, yrgb_mst, dma_addr); -if (fb->format->is_yuv) { + +VOP_WIN_YUV2YUV_SET (vop, win_yuv2yuv, y2r_en, is_yuv); + +if (is_yuv) {int hsub =drm_format_horz_chroma_subsampling (fb->format->format);int vsub =drm_format_vert_chroma_subsampling (fb->format->format);int bpp = fb->format->cpp[1 ];
@@ -781,6 +812,13 @@ static void vop_plane_atomic_update(struct drm_plane *plane, dma_addr = rk_uv_obj->dma_addr + offset + fb->offsets[1 ];VOP_WIN_SET (vop, win, uv_vir,DIV_ROUND_UP (fb->pitches[1 ],4 ));VOP_WIN_SET (vop, win, uv_mst, dma_addr); + +for (i =0 ; i <NUM_YUV2YUV_COEFFICIENTS ; i++) { +VOP_WIN_YUV2YUV_COEFFICIENT_SET (vop, + win_yuv2yuv, + y2r_coefficients[i], + rockchip_bt601_yuv2rgb[i]); + } }if (win->phy->scl)
@@ -1529,6 +1567,7 @@ static void vop_win_init(struct vop *vop) vop_win->data = win_data; vop_win->vop = vop; + vop_win->yuv2yuv_data = &vop_data->win_yuv2yuv[i]; } }
drivers/gpu/drm/rockchip/rockchip_drm_vop.h +13 -0
@@ -23,6 +23,8 @@#define VOP_MAJOR (version) ((version) >> 8)#define VOP_MINOR (version) ((version) & 0xff) +#define NUM_YUV2YUV_COEFFICIENTS 12 +enum vop_data_format {VOP_FMT_ARGB8888 =0 ,VOP_FMT_RGB888 ,
@@ -124,6 +126,10 @@ struct vop_scl_regs {struct vop_reg scale_cbcr_y; }; +struct vop_yuv2yuv_phy { +struct vop_reg y2r_coefficients[NUM_YUV2YUV_COEFFICIENTS ]; +}; +struct vop_win_phy {const struct vop_scl_regs *scl;const uint32_t *data_formats;
@@ -146,6 +152,12 @@ struct vop_win_phy {struct vop_reg channel; }; +struct vop_win_yuv2yuv_data { +uint32_t base; +const struct vop_yuv2yuv_phy *phy; +struct vop_reg y2r_en; +}; +struct vop_win_data {uint32_t base;const struct vop_win_phy *phy;
@@ -159,6 +171,7 @@ struct vop_data {const struct vop_misc *misc;const struct vop_modeset *modeset;const struct vop_output *output; +const struct vop_win_yuv2yuv_data *win_yuv2yuv;const struct vop_win_data *win;unsigned int win_size;
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +36 -0
@@ -637,6 +637,34 @@ static const struct vop_output rk3399_output = { .mipi_dual_channel_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 3), }; +static const struct vop_yuv2yuv_phy rk3399_yuv2yuv_win01_data = { + .y2r_coefficients = { +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +0 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +0 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +4 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +4 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +8 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +8 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +12 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +12 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +16 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +20 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +24 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +28 ,0xffffffff ,0 ), + }, +}; + +static const struct vop_yuv2yuv_phy rk3399_yuv2yuv_win23_data = { }; + +static const struct vop_win_yuv2yuv_data rk3399_vop_big_win_yuv2yuv_data[] = { + { .base =0x00 , .phy = &rk3399_yuv2yuv_win01_data, + .y2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,1 ) }, + { .base =0x60 , .phy = &rk3399_yuv2yuv_win01_data, + .y2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,9 ) }, + { .base =0xC0 , .phy = &rk3399_yuv2yuv_win23_data }, + { .base =0x120 , .phy = &rk3399_yuv2yuv_win23_data }, +}; +static const struct vop_data rk3399_vop_big = { .version =VOP_VERSION (3 ,5 ), .feature =VOP_FEATURE_OUTPUT_RGB10 ,
@@ -647,6 +675,7 @@ static const struct vop_data rk3399_vop_big = { .misc = &rk3368_misc, .win = rk3368_vop_win_data, .win_size = ARRAY_SIZE(rk3368_vop_win_data), + .win_yuv2yuv = rk3399_vop_big_win_yuv2yuv_data, };static const struct vop_win_data rk3399_vop_lit_win_data[] = {
@@ -656,6 +685,12 @@ static const struct vop_win_data rk3399_vop_lit_win_data[] = { .type = DRM_PLANE_TYPE_CURSOR}, }; +static const struct vop_win_yuv2yuv_data rk3399_vop_lit_win_yuv2yuv_data[] = { + { .base =0x00 , .phy = &rk3399_yuv2yuv_win01_data, + .y2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,1 )}, + { .base =0x60 , .phy = &rk3399_yuv2yuv_win23_data }, +}; +static const struct vop_data rk3399_vop_lit = { .version =VOP_VERSION (3 ,6 ), .intr = &rk3366_vop_intr,
@@ -665,6 +700,7 @@ static const struct vop_data rk3399_vop_lit = { .misc = &rk3368_misc, .win = rk3399_vop_lit_win_data, .win_size = ARRAY_SIZE(rk3399_vop_lit_win_data), + .win_yuv2yuv = rk3399_vop_lit_win_yuv2yuv_data, };static const struct vop_win_data rk3228_vop_win_data[] = {
Signature · 6 lines
2.20.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2] drm/rockchip: Fix YUV buffers color rendering
Quoted 20 lines · Ezequiel Garcia
From: Daniele Castagna <[email protected]>
Currently, YUV hardware overlays are converted to RGB using a color space conversion different than BT.601.
The result is that colors of e.g. NV12 buffers don't match colors of YUV hardware overlays.
In order to fix this, enable YUV2YUV and set appropriate coefficients for formats such as NV12 to be displayed correctly.
This commit was tested using modetest, gstreamer and chromeos (hardware accelerated video playback). Before the commit, tests rendering with NV12 format resulted in colors not displayed correctly.
Test examples (RK3399 Ficus board connected to HDMI monitor):
$ modetest 39@32:1920x1080@NV12 $ gst-launch-1.0 videotestrc ! video/x-raw,format=NV12 ! kmssink
Quoted 8 lines
Signed-off-by Daniele Castagna <[email protected]>[ezequiel: rebase on linux-next and massage commit log]Signed-off-by Ezequiel Garcia <[email protected]>---
v2:
* Addressed feedback from Sean Paul
* Rebased on linux-next
Any feedback on this one?
Thanks!
Ezequiel
Quoted 212 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 41 ++++++++++++++++++++- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 13 +++++++ drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 36 ++++++++++++++++++ 3 files changed, 89 insertions(+), 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_drm_vop.c +40
-1@@ -52,6 +52,18 @@ vop_reg_set(vop, &win->phy->scl->ext->name, \ win->base, ~0, v, #name) +#define VOP_WIN_YUV2YUV_SET(x, win_yuv2yuv, name, v) \ + do { \ + if (win_yuv2yuv->name.mask) \ + vop_reg_set(vop, &win_yuv2yuv->name, 0, ~0, v, #name); \ + } while (0) + +#define VOP_WIN_YUV2YUV_COEFFICIENT_SET(x, win_yuv2yuv, name, v) \ + do { \ + if (win_yuv2yuv->phy->name.mask) \ + vop_reg_set(vop, &win_yuv2yuv->phy->name, win_yuv2yuv->base, ~0, v, #name); \ + } while (0) + #define VOP_INTR_SET_MASK(vop, name, mask, v) \ vop_reg_set(vop, &vop->data->intr->name, 0, mask, v, #name)@@ -84,6 +96,18 @@#define to_vop (x) container_of(x, struct vop, crtc)#define to_vop_win (x) container_of(x, struct vop_win, base) +/* +* The coefficients of the following matrix are all fixed points. +* The format is S2.10 for the 3x3 part of the matrix, and S9.12 for the offsets. +* They are all represented in two's complement. +*/ +static const uint32_t rockchip_bt601_yuv2rgb[] = { +0x000004a8 ,0x00000000 ,0x00000662 , +0x000004a8 ,0x00001e6f ,0x00001cbf , +0x000004a8 ,0x00000812 ,0x00000000 , +0x00321168 ,0x000877cf ,0x002eb127 +}; +enum vop_pending {VOP_PENDING_FB_UNREF , };@@ -91,6 +115,7 @@ enum vop_pending {struct vop_win {struct drm_plane base;const struct vop_win_data *data; +const struct vop_win_yuv2yuv_data *yuv2yuv_data;struct vop *vop; };@@ -712,6 +737,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,struct drm_crtc *crtc = state->crtc;struct vop_win *vop_win =to_vop_win (plane);const struct vop_win_data *win = vop_win->data; +const struct vop_win_yuv2yuv_data *win_yuv2yuv = vop_win->yuv2yuv_data;struct vop *vop =to_vop (state->crtc);struct drm_framebuffer *fb = state->fb;unsigned int actual_w, actual_h;@@ -727,6 +753,8 @@ static void vop_plane_atomic_update(struct drm_plane *plane,bool rb_swap;int win_index =VOP_WIN_TO_INDEX (vop_win);int format; +int is_yuv = fb->format->is_yuv; +int i;/* * can't update plane when vop is disabled. @@ -767,7 +795,10 @@ static void vop_plane_atomic_update(struct drm_plane *plane,VOP_WIN_SET (vop, win, format, format);VOP_WIN_SET (vop, win, yrgb_vir,DIV_ROUND_UP (fb->pitches[0 ],4 ));VOP_WIN_SET (vop, win, yrgb_mst, dma_addr); -if (fb->format->is_yuv) { + +VOP_WIN_YUV2YUV_SET (vop, win_yuv2yuv, y2r_en, is_yuv); + +if (is_yuv) {int hsub =drm_format_horz_chroma_subsampling (fb->format->format);int vsub =drm_format_vert_chroma_subsampling (fb->format->format);int bpp = fb->format->cpp[1 ];@@ -781,6 +812,13 @@ static void vop_plane_atomic_update(struct drm_plane *plane, dma_addr = rk_uv_obj->dma_addr + offset + fb->offsets[1 ];VOP_WIN_SET (vop, win, uv_vir,DIV_ROUND_UP (fb->pitches[1 ],4 ));VOP_WIN_SET (vop, win, uv_mst, dma_addr); + +for (i =0 ; i <NUM_YUV2YUV_COEFFICIENTS ; i++) { +VOP_WIN_YUV2YUV_COEFFICIENT_SET (vop, + win_yuv2yuv, + y2r_coefficients[i], + rockchip_bt601_yuv2rgb[i]); + } }if (win->phy->scl)@@ -1529,6 +1567,7 @@ static void vop_win_init(struct vop *vop) vop_win->data = win_data; vop_win->vop = vop; + vop_win->yuv2yuv_data = &vop_data->win_yuv2yuv[i]; } }drivers/gpu/drm/rockchip/rockchip_drm_vop.h +13
-0@@ -23,6 +23,8 @@#define VOP_MAJOR (version) ((version) >> 8)#define VOP_MINOR (version) ((version) & 0xff) +#define NUM_YUV2YUV_COEFFICIENTS 12 +enum vop_data_format {VOP_FMT_ARGB8888 =0 ,VOP_FMT_RGB888 ,@@ -124,6 +126,10 @@ struct vop_scl_regs {struct vop_reg scale_cbcr_y; }; +struct vop_yuv2yuv_phy { +struct vop_reg y2r_coefficients[NUM_YUV2YUV_COEFFICIENTS ]; +}; +struct vop_win_phy {const struct vop_scl_regs *scl;const uint32_t *data_formats;@@ -146,6 +152,12 @@ struct vop_win_phy {struct vop_reg channel; }; +struct vop_win_yuv2yuv_data { +uint32_t base; +const struct vop_yuv2yuv_phy *phy; +struct vop_reg y2r_en; +}; +struct vop_win_data {uint32_t base;const struct vop_win_phy *phy;@@ -159,6 +171,7 @@ struct vop_data {const struct vop_misc *misc;const struct vop_modeset *modeset;const struct vop_output *output; +const struct vop_win_yuv2yuv_data *win_yuv2yuv;const struct vop_win_data *win;unsigned int win_size;drivers/gpu/drm/rockchip/rockchip_vop_reg.c +35
-0@@ -637,6 +637,34 @@ static const struct vop_output rk3399_output = { .mipi_dual_channel_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 3), }; +static const struct vop_yuv2yuv_phy rk3399_yuv2yuv_win01_data = { + .y2r_coefficients = { +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +0 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +0 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +4 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +4 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +8 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +8 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +12 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +12 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +16 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +20 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +24 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +28 ,0xffffffff ,0 ), + }, +}; + +static const struct vop_yuv2yuv_phy rk3399_yuv2yuv_win23_data = { }; + +static const struct vop_win_yuv2yuv_data rk3399_vop_big_win_yuv2yuv_data[] = { + { .base =0x00 , .phy = &rk3399_yuv2yuv_win01_data, + .y2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,1 ) }, + { .base =0x60 , .phy = &rk3399_yuv2yuv_win01_data, + .y2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,9 ) }, + { .base =0xC0 , .phy = &rk3399_yuv2yuv_win23_data }, + { .base =0x120 , .phy = &rk3399_yuv2yuv_win23_data }, +}; +static const struct vop_data rk3399_vop_big = { .version =VOP_VERSION (3 ,5 ), .feature =VOP_FEATURE_OUTPUT_RGB10 ,@@ -647,6 +675,7 @@ static const struct vop_data rk3399_vop_big = { .misc = &rk3368_misc, .win = rk3368_vop_win_data, .win_size = ARRAY_SIZE(rk3368_vop_win_data), + .win_yuv2yuv = rk3399_vop_big_win_yuv2yuv_data, };static const struct vop_win_data rk3399_vop_lit_win_data[] = {@@ -656,6 +685,12 @@ static const struct vop_win_data rk3399_vop_lit_win_data[] = { .type = DRM_PLANE_TYPE_CURSOR}, }; +static const struct vop_win_yuv2yuv_data rk3399_vop_lit_win_yuv2yuv_data[] = { + { .base =0x00 , .phy = &rk3399_yuv2yuv_win01_data, + .y2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,1 )}, + { .base =0x60 , .phy = &rk3399_yuv2yuv_win23_data }, +}; +static const struct vop_data rk3399_vop_lit = { .version =VOP_VERSION (3 ,6 ), .intr = &rk3366_vop_intr,
drivers/gpu/drm/rockchip/rockchip_vop_reg.c static const struct vop_data rk3399_vop_lit = { · line 706
Quoted 7 lines
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +1
-0@@ -665,6 +700,7 @@ static const struct vop_data rk3399_vop_lit = { .misc = &rk3368_misc, .win = rk3399_vop_lit_win_data, .win_size = ARRAY_SIZE(rk3399_vop_lit_win_data), + .win_yuv2yuv = rk3399_vop_lit_win_yuv2yuv_data, };static const struct vop_win_data rk3228_vop_win_data[] = {
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Heiko Stuebner
maintainerRe: [PATCH v2] drm/rockchip: Fix YUV buffers color rendering
In reply to Ezequiel GarciaHi,
sorry, only now got to test this on actual hardware,
Am Freitag, 14. Dezember 2018, 17:29:20 CET schrieb Ezequiel Garcia:
Quoted 43 lines
From: Daniele Castagna <[email protected]>
Currently, YUV hardware overlays are converted to RGB using a color space conversion different than BT.601.
The result is that colors of e.g. NV12 buffers don't match colors of YUV hardware overlays.
In order to fix this, enable YUV2YUV and set appropriate coefficients for formats such as NV12 to be displayed correctly.
This commit was tested using modetest, gstreamer and chromeos (hardware accelerated video playback). Before the commit, tests rendering with NV12 format resulted in colors not displayed correctly.
Test examples (RK3399 Ficus board connected to HDMI monitor):
$ modetest 39@32:1920x1080@NV12 $ gst-launch-1.0 videotestrc ! video/x-raw,format=NV12 ! kmssinkSigned-off-by Daniele Castagna <[email protected]>[ezequiel: rebase on linux-next and massage commit log]Signed-off-by Ezequiel Garcia <[email protected]>---
v2:
* Addressed feedback from Sean Paul
* Rebased on linux-nextdrivers/gpu/drm/rockchip/rockchip_drm_vop.c | 41 ++++++++++++++++++++- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 13 +++++++ drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 36 ++++++++++++++++++ 3 files changed, 89 insertions(+), 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_drm_vop.c +2
-0@@ -52,6 +52,18 @@ vop_reg_set(vop, &win->phy->scl->ext->name, \ win->base, ~0, v, #name) +#define VOP_WIN_YUV2YUV_SET(x, win_yuv2yuv, name, v) \ + do { \
drivers/gpu/drm/rockchip/rockchip_drm_vop.c line 66
Quoted 10 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +10
-0+ if (win_yuv2yuv->name.mask) \ + vop_reg_set(vop, &win_yuv2yuv->name, 0, ~0, v, #name); \ + } while (0) + +#define VOP_WIN_YUV2YUV_COEFFICIENT_SET (x, win_yuv2yuv, name, v) \ + do { \ + if (win_yuv2yuv->phy->name.mask) \ + vop_reg_set(vop, &win_yuv2yuv->phy->name, win_yuv2yuv->base, ~0, v, #name); \ + } while (0) +
While this seems to work on rk3399, it hangs both my rk3328 (rock64) and rk3288 (google-pinky) during rockchip-drm probe.
Making this something like
if (win_yuv2yuv && win_yuv2yuv->phy->name.mask) \
aka testing for existence of win_yuv2yuv first, makes them boot again, so I guess I ran into a (for whatever reason) silent null-ptr-dereference.
Quoted 16 lines
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +8
-0@@ -637,6 +637,34 @@ static const struct vop_output rk3399_output = { .mipi_dual_channel_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 3), }; +static const struct vop_yuv2yuv_phy rk3399_yuv2yuv_win01_data = { + .y2r_coefficients = { +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +0 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +0 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +4 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +4 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +8 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +8 ,0xffff ,16 ),
drivers/gpu/drm/rockchip/rockchip_vop_reg.c static const struct vop_output rk3399_output = { · line 657
Quoted 10 lines
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +10
-0+ VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 12, 0xffff, 0), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 12, 0xffff, 16), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 16, 0xffff, 0), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 20, 0xffffffff, 0), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 24, 0xffffffff, 0), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 28, 0xffffffff, 0), + }, +}; + +static const struct vop_yuv2yuv_phy rk3399_yuv2yuv_win23_data = { };
looking at the rk3399 TRM it seems that win2+3 also have yuv2rgb coefficient registers. I didn't check in depth but are they so different that they cannot be supported?
Aka what is the difference between win0/1 and win2/3 ?
Heiko
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2] drm/rockchip: Fix YUV buffers color rendering
Quoted 46 lines · Heiko Stuebner
Hi,
sorry, only now got to test this on actual hardware,
Am Freitag, 14. Dezember 2018, 17:29:20 CET schrieb Ezequiel Garcia:
Quoted 41 lines
From: Daniele Castagna <[email protected]>
Currently, YUV hardware overlays are converted to RGB using a color space conversion different than BT.601.
The result is that colors of e.g. NV12 buffers don't match colors of YUV hardware overlays.
In order to fix this, enable YUV2YUV and set appropriate coefficients for formats such as NV12 to be displayed correctly.
This commit was tested using modetest, gstreamer and chromeos (hardware accelerated video playback). Before the commit, tests rendering with NV12 format resulted in colors not displayed correctly.
Test examples (RK3399 Ficus board connected to HDMI monitor):
$ modetest 39@32:1920x1080@NV12 $ gst-launch-1.0 videotestrc ! video/x-raw,format=NV12 ! kmssinkSigned-off-by Daniele Castagna <[email protected]>[ezequiel: rebase on linux-next and massage commit log]Signed-off-by Ezequiel Garcia <ezequiel-ZGY8ohtN/[email protected]>---
v2:
* Addressed feedback from Sean Paul
* Rebased on linux-nextdrivers/gpu/drm/rockchip/rockchip_drm_vop.c | 41 ++++++++++++++++++++- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 13 +++++++ drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 36 ++++++++++++++++++ 3 files changed, 89 insertions(+), 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_drm_vop.c +0
-0@@ -52,6 +52,18 @@vop_reg_set (vop, &win->phy->scl->ext->name, \ win->base, ~0, v, #name)
Quoted 16 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c line 66
Quoted 12 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +12
-0+#define VOP_WIN_YUV2YUV_SET (x, win_yuv2yuv, name, v) \ + do { \ + if (win_yuv2yuv->name.mask) \ + vop_reg_set(vop, &win_yuv2yuv->name, 0, ~0, v, #name); \ + } while (0) + +#define VOP_WIN_YUV2YUV_COEFFICIENT_SET (x, win_yuv2yuv, name, v) \ + do { \ + if (win_yuv2yuv->phy->name.mask) \ + vop_reg_set(vop, &win_yuv2yuv->phy->name, win_yuv2yuv->base, ~0, v, #name); \ + } while (0) +While this seems to work on rk3399, it hangs both my rk3328 (rock64) and rk3288 (google-pinky) during rockchip-drm probe.
Oh, shame on me, I should've done that.
Quoted 7 lines
Making this something like
if (win_yuv2yuv && win_yuv2yuv->phy->name.mask) \aka testing for existence of
win_yuv2yuvfirst, makes them boot again, so I guess I ran into a (for whatever reason) silent null-ptr-dereference.
Sounds good. I'll post a v3.
Quoted 32 lines
Quoted 17 lines
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +8
-0@@ -637,6 +637,34 @@ static const struct vop_output rk3399_output = { .mipi_dual_channel_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 3), }; +static const struct vop_yuv2yuv_phy rk3399_yuv2yuv_win01_data = { + .y2r_coefficients = { +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +0 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +0 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +4 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +4 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +8 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +8 ,0xffff ,16 ),drivers/gpu/drm/rockchip/rockchip_vop_reg.c static const struct vop_output rk3399_output = { · line 657
Quoted 10 lines
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +10
-0+ VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 12, 0xffff, 0), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 12, 0xffff, 16), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 16, 0xffff, 0), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 20, 0xffffffff, 0), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 24, 0xffffffff, 0), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 28, 0xffffffff, 0), + }, +}; + +static const struct vop_yuv2yuv_phy rk3399_yuv2yuv_win23_data = { };looking at the rk3399 TRM it seems that win2+3 also have yuv2rgb coefficient registers. I didn't check in depth but are they so different that they cannot be supported?
Quoted 3 lines
Aka what is the difference between win0/1 and win2/3 ?
I think Sandy is the best to answer this. I can't say I'm an expert on the details of this hardware.
Thanks,
Eze
Re: [PATCH v2] drm/rockchip: Fix YUV buffers color rendering
Quoted 107 lines · Ezequiel Garcia
Quoted 46 lines · Heiko Stuebner
Hi,
sorry, only now got to test this on actual hardware,
Am Freitag, 14. Dezember 2018, 17:29:20 CET schrieb Ezequiel Garcia:
Quoted 41 lines
From: Daniele Castagna <[email protected]>
Currently, YUV hardware overlays are converted to RGB using a color space conversion different than BT.601.
The result is that colors of e.g. NV12 buffers don't match colors of YUV hardware overlays.
In order to fix this, enable YUV2YUV and set appropriate coefficients for formats such as NV12 to be displayed correctly.
This commit was tested using modetest, gstreamer and chromeos (hardware accelerated video playback). Before the commit, tests rendering with NV12 format resulted in colors not displayed correctly.
Test examples (RK3399 Ficus board connected to HDMI monitor):
$ modetest 39@32:1920x1080@NV12 $ gst-launch-1.0 videotestrc ! video/x-raw,format=NV12 ! kmssinkSigned-off-by Daniele Castagna <[email protected]>[ezequiel: rebase on linux-next and massage commit log]Signed-off-by Ezequiel Garcia <[email protected]>---
v2:
* Addressed feedback from Sean Paul
* Rebased on linux-nextdrivers/gpu/drm/rockchip/rockchip_drm_vop.c | 41 ++++++++++++++++++++- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 13 +++++++ drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 36 ++++++++++++++++++ 3 files changed, 89 insertions(+), 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_drm_vop.c +0
-0@@ -52,6 +52,18 @@vop_reg_set (vop, &win->phy->scl->ext->name, \ win->base, ~0, v, #name)Quoted 16 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c line 66
Quoted 12 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +12
-0+#define VOP_WIN_YUV2YUV_SET (x, win_yuv2yuv, name, v) \ + do { \ + if (win_yuv2yuv->name.mask) \ + vop_reg_set(vop, &win_yuv2yuv->name, 0, ~0, v, #name); \ + } while (0) + +#define VOP_WIN_YUV2YUV_COEFFICIENT_SET (x, win_yuv2yuv, name, v) \ + do { \ + if (win_yuv2yuv->phy->name.mask) \ + vop_reg_set(vop, &win_yuv2yuv->phy->name, win_yuv2yuv->base, ~0, v, #name); \ + } while (0) +While this seems to work on rk3399, it hangs both my rk3328 (rock64) and rk3288 (google-pinky) during rockchip-drm probe.
Oh, shame on me, I should've done that.
Quoted 7 lines
Making this something like
if (win_yuv2yuv && win_yuv2yuv->phy->name.mask) \aka testing for existence of
win_yuv2yuvfirst, makes them boot again, so I guess I ran into a (for whatever reason) silent null-ptr-dereference.Sounds good. I'll post a v3.
Quoted 31 lines
Quoted 16 lines
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +8
-0@@ -637,6 +637,34 @@ static const struct vop_output rk3399_output = { .mipi_dual_channel_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 3), }; +static const struct vop_yuv2yuv_phy rk3399_yuv2yuv_win01_data = { + .y2r_coefficients = { +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +0 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +0 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +4 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +4 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +8 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +8 ,0xffff ,16 ),drivers/gpu/drm/rockchip/rockchip_vop_reg.c static const struct vop_output rk3399_output = { · line 657
Quoted 10 lines
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +10
-0+ VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 12, 0xffff, 0), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 12, 0xffff, 16), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 16, 0xffff, 0), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 20, 0xffffffff, 0), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 24, 0xffffffff, 0), + VOP_REG(RK3399_WIN0_YUV2YUV_Y2R + 28, 0xffffffff, 0), + }, +}; + +static const struct vop_yuv2yuv_phy rk3399_yuv2yuv_win23_data = { };looking at the rk3399 TRM it seems that win2+3 also have yuv2rgb coefficient registers. I didn't check in depth but are they so different that they cannot be supported?
Quoted 7 lines
Quoted 3 lines
Aka what is the difference between win0/1 and win2/3 ?
I think Sandy is the best to answer this. I can't say I'm an expert on the details of this hardware.
Reading thru the spec, I see what wins 2 and 3 don't support YUV formats, so the feature (whatever it's purpose) is not needed, as there's no YUV colorspace issue.
Like I said, I don't have specific knowledge on the hardware.
Thanks,
Eze
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 1/1 drm/rockchip: Fix YUV buffers color rendering
In reply to Ezequiel GarciaFrom: Daniele Castagna <[email protected]>
Currently, YUV hardware overlays are converted to RGB using a color space conversion different than BT.601.
The result is that colors of e.g. NV12 buffers don't match colors of YUV hardware overlays.
In order to fix this, enable YUV2YUV and set appropriate coefficients for formats such as NV12 to be displayed correctly.
This commit was tested using modetest, gstreamer and chromeos (hardware accelerated video playback). Before the commit, tests rendering with NV12 format resulted in colors not displayed correctly.
Test examples (Tested on RK3399 and RK3288 boards connected to HDMI monitor):
$ modetest 39@32:1920x1080@NV12 $ gst-launch-1.0 videotestrc ! video/x-raw,format=NV12 ! kmssink
---
v3: Add a check for non-null win_yuv2yuv as suggested by Heiko.
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 40 ++++++++++++++++++++- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 13 +++++++ drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 36 +++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +39 -1
@@ -53,6 +53,18 @@ vop_reg_set(vop, &win->phy->scl->ext->name, \ win->base, ~0, v, #name) +#define VOP_WIN_YUV2YUV_SET(x, win_yuv2yuv, name, v) \ + do { \ + if (win_yuv2yuv && win_yuv2yuv->name.mask) \ + vop_reg_set(vop, &win_yuv2yuv->name, 0, ~0, v, #name); \ + } while (0) + +#define VOP_WIN_YUV2YUV_COEFFICIENT_SET(x, win_yuv2yuv, name, v) \ + do { \ + if (win_yuv2yuv && win_yuv2yuv->phy->name.mask) \ + vop_reg_set(vop, &win_yuv2yuv->phy->name, win_yuv2yuv->base, ~0, v, #name); \ + } while (0) + #define VOP_INTR_SET_MASK(vop, name, mask, v) \ vop_reg_set(vop, &vop->data->intr->name, 0, mask, v, #name)
@@ -85,6 +97,18 @@#define to_vop (x) container_of(x, struct vop, crtc)#define to_vop_win (x) container_of(x, struct vop_win, base) +/* +* The coefficients of the following matrix are all fixed points. +* The format is S2.10 for the 3x3 part of the matrix, and S9.12 for the offsets. +* They are all represented in two's complement. +*/ +static const uint32_t bt601_yuv2rgb[] = { +0x4A8 ,0x0 ,0x662 , +0x4A8 ,0x1E6F ,0x1CBF , +0x4A8 ,0x812 ,0x0 , +0x321168 ,0x0877CF ,0x2EB127 +}; +enum vop_pending {VOP_PENDING_FB_UNREF , };
@@ -92,6 +116,7 @@ enum vop_pending {struct vop_win {struct drm_plane base;const struct vop_win_data *data; +const struct vop_win_yuv2yuv_data *yuv2yuv_data;struct vop *vop; };
@@ -713,6 +738,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,struct drm_crtc *crtc = state->crtc;struct vop_win *vop_win =to_vop_win (plane);const struct vop_win_data *win = vop_win->data; +const struct vop_win_yuv2yuv_data *win_yuv2yuv = vop_win->yuv2yuv_data;struct vop *vop =to_vop (state->crtc);struct drm_framebuffer *fb = state->fb;unsigned int actual_w, actual_h;
@@ -728,6 +754,8 @@ static void vop_plane_atomic_update(struct drm_plane *plane,bool rb_swap;int win_index =VOP_WIN_TO_INDEX (vop_win);int format; +int is_yuv = fb->format->is_yuv; +int i;/* * can't update plane when vop is disabled.
@@ -768,7 +796,9 @@ static void vop_plane_atomic_update(struct drm_plane *plane,VOP_WIN_SET (vop, win, format, format);VOP_WIN_SET (vop, win, yrgb_vir,DIV_ROUND_UP (fb->pitches[0 ],4 ));VOP_WIN_SET (vop, win, yrgb_mst, dma_addr); -if (fb->format->is_yuv) { +VOP_WIN_YUV2YUV_SET (vop, win_yuv2yuv, y2r_en, is_yuv); + +if (is_yuv) {int hsub =drm_format_horz_chroma_subsampling (fb->format->format);int vsub =drm_format_vert_chroma_subsampling (fb->format->format);int bpp = fb->format->cpp[1 ];
@@ -782,6 +812,13 @@ static void vop_plane_atomic_update(struct drm_plane *plane, dma_addr = rk_uv_obj->dma_addr + offset + fb->offsets[1 ];VOP_WIN_SET (vop, win, uv_vir,DIV_ROUND_UP (fb->pitches[1 ],4 ));VOP_WIN_SET (vop, win, uv_mst, dma_addr); + +for (i =0 ; i <NUM_YUV2YUV_COEFFICIENTS ; i++) { +VOP_WIN_YUV2YUV_COEFFICIENT_SET (vop, + win_yuv2yuv, + y2r_coefficients[i], + bt601_yuv2rgb[i]); + } }if (win->phy->scl)
@@ -1531,6 +1568,7 @@ static void vop_win_init(struct vop *vop) vop_win->data = win_data; vop_win->vop = vop; + vop_win->yuv2yuv_data = &vop_data->win_yuv2yuv[i]; } }
drivers/gpu/drm/rockchip/rockchip_drm_vop.h +13 -0
@@ -23,6 +23,8 @@#define VOP_MAJOR (version) ((version) >> 8)#define VOP_MINOR (version) ((version) & 0xff) +#define NUM_YUV2YUV_COEFFICIENTS 12 +enum vop_data_format {VOP_FMT_ARGB8888 =0 ,VOP_FMT_RGB888 ,
@@ -124,6 +126,10 @@ struct vop_scl_regs {struct vop_reg scale_cbcr_y; }; +struct vop_yuv2yuv_phy { +struct vop_reg y2r_coefficients[NUM_YUV2YUV_COEFFICIENTS ]; +}; +struct vop_win_phy {const struct vop_scl_regs *scl;const uint32_t *data_formats;
@@ -146,6 +152,12 @@ struct vop_win_phy {struct vop_reg channel; }; +struct vop_win_yuv2yuv_data { +uint32_t base; +const struct vop_yuv2yuv_phy *phy; +struct vop_reg y2r_en; +}; +struct vop_win_data {uint32_t base;const struct vop_win_phy *phy;
@@ -159,6 +171,7 @@ struct vop_data {const struct vop_misc *misc;const struct vop_modeset *modeset;const struct vop_output *output; +const struct vop_win_yuv2yuv_data *win_yuv2yuv;const struct vop_win_data *win;unsigned int win_size;
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +36 -0
@@ -637,6 +637,34 @@ static const struct vop_output rk3399_output = { .mipi_dual_channel_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 3), }; +static const struct vop_yuv2yuv_phy rk3399_yuv2yuv_win01_data = { + .y2r_coefficients = { +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +0 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +0 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +4 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +4 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +8 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +8 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +12 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +12 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +16 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +20 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +24 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_Y2R +28 ,0xffffffff ,0 ), + }, +}; + +static const struct vop_yuv2yuv_phy rk3399_yuv2yuv_win23_data = { }; + +static const struct vop_win_yuv2yuv_data rk3399_vop_big_win_yuv2yuv_data[] = { + { .base =0x00 , .phy = &rk3399_yuv2yuv_win01_data, + .y2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,1 ) }, + { .base =0x60 , .phy = &rk3399_yuv2yuv_win01_data, + .y2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,9 ) }, + { .base =0xC0 , .phy = &rk3399_yuv2yuv_win23_data }, + { .base =0x120 , .phy = &rk3399_yuv2yuv_win23_data }, +}; +static const struct vop_data rk3399_vop_big = { .version =VOP_VERSION (3 ,5 ), .feature =VOP_FEATURE_OUTPUT_RGB10 ,
@@ -647,6 +675,7 @@ static const struct vop_data rk3399_vop_big = { .misc = &rk3368_misc, .win = rk3368_vop_win_data, .win_size = ARRAY_SIZE(rk3368_vop_win_data), + .win_yuv2yuv = rk3399_vop_big_win_yuv2yuv_data, };static const struct vop_win_data rk3399_vop_lit_win_data[] = {
@@ -656,6 +685,12 @@ static const struct vop_win_data rk3399_vop_lit_win_data[] = { .type = DRM_PLANE_TYPE_CURSOR}, }; +static const struct vop_win_yuv2yuv_data rk3399_vop_lit_win_yuv2yuv_data[] = { + { .base =0x00 , .phy = &rk3399_yuv2yuv_win01_data, + .y2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,1 )}, + { .base =0x60 , .phy = &rk3399_yuv2yuv_win23_data }, +}; +static const struct vop_data rk3399_vop_lit = { .version =VOP_VERSION (3 ,6 ), .intr = &rk3366_vop_intr,
@@ -665,6 +700,7 @@ static const struct vop_data rk3399_vop_lit = { .misc = &rk3368_misc, .win = rk3399_vop_lit_win_data, .win_size = ARRAY_SIZE(rk3399_vop_lit_win_data), + .win_yuv2yuv = rk3399_vop_lit_win_yuv2yuv_data, };static const struct vop_win_data rk3228_vop_win_data[] = {
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3] drm/rockchip: Fix YUV buffers color rendering
Am Dienstag, 8. Januar 2019, 22:46:59 CET schrieb Ezequiel Garcia:
Quoted 17 lines
From: Daniele Castagna <[email protected]>
Currently, YUV hardware overlays are converted to RGB using a color space conversion different than BT.601.
The result is that colors of e.g. NV12 buffers don't match colors of YUV hardware overlays.
In order to fix this, enable YUV2YUV and set appropriate coefficients for formats such as NV12 to be displayed correctly.
This commit was tested using modetest, gstreamer and chromeos (hardware accelerated video playback). Before the commit, tests rendering with NV12 format resulted in colors not displayed correctly.
Test examples (Tested on RK3399 and RK3288 boards connected to HDMI monitor):
Quoted 8 lines
$ modetest 39@32:1920x1080@NV12 $ gst-launch-1.0 videotestrc ! video/x-raw,format=NV12 ! kmssinkSigned-off-by Daniele Castagna <[email protected]>[ezequiel: rebase on linux-next and massage commit log]Signed-off-by Ezequiel Garcia <[email protected]>---
v3: Add a check for non-nullwin_yuv2yuvas suggested by Heiko.
applied to drm-misc-next after making sure that display keeps working on all rockchip socs now
Thanks
Heiko
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/10 drm: Add Plane Degamma properties
In reply to Daniele CastagnaFrom: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Add Plane Degamma as a blob property and plane
degamma size as a range property.
(am from https://patchwork.kernel.org/patch/10046515/)
Change-Id: Iaead6f944a8b677227d1be11169f46178de533b1
Signed-off-by: Uma Shankar <uma.shankar at intel.com>
--- drivers/gpu/drm/drm_atomic.c | 12 ++++++++++++ drivers/gpu/drm/drm_atomic_helper.c | 7 +++++++ drivers/gpu/drm/drm_mode_config.c | 14 ++++++++++++++ include/drm/drm_mode_config.h | 10 ++++++++++ include/drm/drm_plane.h | 10 ++++++++++ 5 files changed, 53 insertions(+)
drivers/gpu/drm/drm_atomic.c +12 -0
@@ -717,6 +717,8 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, {struct drm_device *dev = plane->dev;struct drm_mode_config *config = &dev->mode_config; +bool replaced = false; +int ret;if (property == config->prop_fb_id) {struct drm_framebuffer *fb =drm_framebuffer_lookup (dev,NULL , val);
@@ -762,6 +764,12 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, }else if (plane->funcs->atomic_set_property) {return plane->funcs->atomic_set_property (plane, state, property, val); + }else if (property == config->plane_degamma_lut_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->degamma_lut, + val,-1 , &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }
@@ -820,6 +828,9 @@ drm_atomic_plane_get_property(struct drm_plane *plane, *val = state->zpos; }else if (plane->funcs->atomic_get_property) {return plane->funcs->atomic_get_property (plane, state, property, val); + }else if (property == config->plane_degamma_lut_property) { + *val = (state->degamma_lut) ? + state->degamma_lut->base.id :0 ; }else {return -EINVAL ; }
@@ -944,6 +955,7 @@ static void drm_atomic_plane_print_state(struct drm_printer *p,drm_printf (p,"\tcrtc-pos=" DRM_RECT_FMT "\n" ,DRM_RECT_ARG (&dest));drm_printf (p,"\tsrc-pos=" DRM_RECT_FP_FMT "\n" ,DRM_RECT_FP_ARG (&src));drm_printf (p,"\trotation=%x\n" , state->rotation); +drm_printf (p,"\tcolor_mgmt_changed=%d\n" , state->color_mgmt_changed);if (plane->funcs->atomic_print_state) plane->funcs->atomic_print_state (p, state);
drivers/gpu/drm/drm_atomic_helper.c +7 -0
@@ -3488,7 +3488,12 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,drm_framebuffer_get (state->fb); state->fence =NULL ; + state->commit =NULL ; + +if (state->degamma_lut) +drm_property_reference_blob (state->degamma_lut); + state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);
@@ -3533,6 +3538,8 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)if (state->commit)drm_crtc_commit_put (state->commit); + +drm_property_unreference_blob (state->degamma_lut); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);
drivers/gpu/drm/drm_mode_config.c +14 -0
@@ -348,6 +348,20 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.modifiers_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_DEGAMMA_LUT" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_degamma_lut_property = prop; + + prop =drm_property_create_range (dev, +DRM_MODE_PROP_IMMUTABLE , +"PLANE_DEGAMMA_LUT_SIZE" ,0 ,UINT_MAX ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_degamma_lut_size_property = prop; +return 0 ; }
include/drm/drm_mode_config.h +10 -0
@@ -724,6 +724,16 @@ struct drm_mode_config {* the degamma LUT as supported by the driver (read-only). */ struct drm_property *degamma_lut_size_property; +/** +* @plane_degamma_lut_property: Optional Plane property to set the LUT +* used to convert the framebuffer's colors to linear gamma. +*/ +struct drm_property *plane_degamma_lut_property; +/** +* @plane_degamma_lut_size_property: Optional Plane property for the +* size of the degamma LUT as supported by the driver (read-only). +*/ +struct drm_property *plane_degamma_lut_size_property;/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the
include/drm/drm_plane.h +10 -0
@@ -131,7 +131,17 @@ struct drm_plane_state {*/ struct drm_crtc_commit *commit; +/* @degamma_lut: +* +* Lookup table for converting framebuffer pixel data before apply the +* color conversion matrix @ctm. See drm_plane_enable_color_mgmt(). The +* blob (if not NULL) is an array of &struct drm_color_lut. +*/ +struct drm_property_blob *degamma_lut; +struct drm_atomic_state *state; + + bool color_mgmt_changed : 1; }; static inline struct drm_rect
Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
kbuild test robot
build botRe: [PATCH 02/10] drm: Add Plane Degamma properties
Thank you for the patch! Perhaps something to improve:
Hi uma.shankar,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on rockchip/for-next]
[also build test WARNING on v4.16-rc1 next-20180216]
[cannot apply to drm/drm-next]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Daniele-Castagna/drm-rockchip-YUV-overlays-BT-601-color-conversion/20180216-233006 base: https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next reproduce: make htmldocs
All warnings (new ones prefixed by >>):
include/linux/crypto.h:477: warning: Function parameter or member 'cra_u.blkcipher' not described in 'crypto_alg' include/linux/crypto.h:477: warning: Function parameter or member 'cra_u.cipher' not described in 'crypto_alg' include/linux/crypto.h:477: warning: Function parameter or member 'cra_u.compress' not described in 'crypto_alg' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.ibss' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.connect' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.keys' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.ie' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.ie_len' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.bssid' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.prev_bssid' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.ssid' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.default_key' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.default_mgmt_key' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.prev_bssid_valid' not described in 'wireless_dev' include/net/mac80211.h:2259: warning: Function parameter or member 'radiotap_timestamp.units_pos' not described in 'ieee80211_hw' include/net/mac80211.h:2259: warning: Function parameter or member 'radiotap_timestamp.accuracy' not described in 'ieee80211_hw' include/net/mac80211.h:950: warning: Function parameter or member 'rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.rts_cts_rate_idx' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.use_rts' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.use_cts_prot' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.short_preamble' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.skip_table' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.jiffies' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.vif' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.hw_key' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.flags' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.enqueue_time' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'ack' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'ack.cookie' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'status.rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'status.ack_signal' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'status.ampdu_ack_len' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'status.ampdu_len' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'status.antenna' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'status.tx_time' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'status_driver_data' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'driver_rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'pad' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'rate_driver_data' not described in 'ieee80211_tx_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'rx_stats_avg' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'rx_stats_avg.signal' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'rx_stats_avg.chain_signal' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'status_stats.filtered' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'status_stats.retry_failed' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'status_stats.retry_count' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'status_stats.lost_packets' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'status_stats.last_tdls_pkt_time' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'msdu_retries' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'msdu_failed' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'status_stats.last_ack' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'tx_stats.packets' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'tx_stats.bytes' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'tx_stats.last_rate' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'msdu' not described in 'sta_info' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_excl.cb' not described in 'dma_buf' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_excl.poll' not described in 'dma_buf' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_excl.active' not described in 'dma_buf' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_shared.cb' not described in 'dma_buf' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_shared.poll' not described in 'dma_buf' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_shared.active' not described in 'dma_buf' include/linux/dma-fence-array.h:54: warning: Function parameter or member 'work' not described in 'dma_fence_array' include/linux/gpio/driver.h:142: warning: Function parameter or member 'request_key' not described in 'gpio_irq_chip' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.sign' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.realbits' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.storagebits' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.shift' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.repeat' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.endianness' not described in 'iio_chan_spec' include/linux/iio/hw-consumer.h:1: warning: no structured comments found
include/linux/device.h:294: warning: Function parameter or member 'coredump' not described in 'device_driver' include/linux/input/sparse-keymap.h:46: warning: Function parameter or member 'sw' not described in 'key_entry' include/linux/mtd/rawnand.h:709: warning: Function parameter or member 'timings.sdr' not described in 'nand_data_interface' include/linux/mtd/rawnand.h:774: warning: Function parameter or member 'buf' not described in 'nand_op_data_instr' include/linux/mtd/rawnand.h:774: warning: Function parameter or member 'buf.in' not described in 'nand_op_data_instr' include/linux/mtd/rawnand.h:774: warning: Function parameter or member 'buf.out' not described in 'nand_op_data_instr' include/linux/mtd/rawnand.h:820: warning: Function parameter or member 'ctx' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:820: warning: Function parameter or member 'ctx.cmd' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:820: warning: Function parameter or member 'ctx.addr' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:820: warning: Function parameter or member 'ctx.data' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:820: warning: Function parameter or member 'ctx.waitrdy' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:967: warning: Function parameter or member 'ctx' not described in 'nand_op_parser_pattern_elem' include/linux/mtd/rawnand.h:967: warning: Function parameter or member 'ctx.addr' not described in 'nand_op_parser_pattern_elem' include/linux/mtd/rawnand.h:967: warning: Function parameter or member 'ctx.data' not described in 'nand_op_parser_pattern_elem' include/linux/mtd/rawnand.h:1281: warning: Function parameter or member 'manufacturer.desc' not described in 'nand_chip' include/linux/mtd/rawnand.h:1281: warning: Function parameter or member 'manufacturer.priv' not described in 'nand_chip' include/linux/regulator/driver.h:221: warning: Function parameter or member 'resume_early' not described in 'regulator_ops' drivers/regulator/core.c:4299: warning: Excess function parameter 'state' description in 'regulator_suspend_late' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw0' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw1' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw2' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw3' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.eadm' not described in 'irb' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_pin' not described in 'drm_driver' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_unpin' not described in 'drm_driver' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_res_obj' not described in 'drm_driver' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_get_sg_table' not described in 'drm_driver' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_import_sg_table' not described in 'drm_driver' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_vmap' not described in 'drm_driver' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_vunmap' not described in 'drm_driver' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_mmap' not described in 'drm_driver'
>> include/drm/drm_plane.h:146: warning: Function parameter or member 'degamma_lut' not described in 'drm_plane_state' >> include/drm/drm_plane.h:146: warning: Function parameter or member 'color_mgmt_changed' not described in 'drm_plane_state'
include/drm/drm_connector.h:370: warning: Function parameter or member 'margins.left' not described in 'drm_tv_connector_state' include/drm/drm_connector.h:370: warning: Function parameter or member 'margins.right' not described in 'drm_tv_connector_state' include/drm/drm_connector.h:370: warning: Function parameter or member 'margins.top' not described in 'drm_tv_connector_state' include/drm/drm_connector.h:370: warning: Function parameter or member 'margins.bottom' not described in 'drm_tv_connector_state' include/drm/drm_vblank.h:63: warning: Function parameter or member 'event.base' not described in 'drm_pending_vblank_event' include/drm/drm_vblank.h:63: warning: Function parameter or member 'event.vbl' not described in 'drm_pending_vblank_event' include/drm/drm_vblank.h:63: warning: Function parameter or member 'event.seq' not described in 'drm_pending_vblank_event' drivers/gpu/drm/tve200/tve200_drv.c:1: warning: no structured comments found
include/linux/skbuff.h:846: warning: Function parameter or member 'dev_scratch' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'skb_mstamp' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member '__cloned_offset' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'head_frag' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member '__unused' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member '__pkt_type_offset' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'pfmemalloc' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'encapsulation' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'encap_hdr_csum' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'csum_valid' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'csum_complete_sw' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'csum_level' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'inner_protocol_type' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'remcsum_offload' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'offload_fwd_mark' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'offload_mr_fwd_mark' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'sender_cpu' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff' include/net/sock.h:234: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_portpair' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_cookie' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_listener' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common' include/net/sock.h:487: warning: Function parameter or member 'sk_backlog.rmem_alloc' not described in 'sock' include/net/sock.h:487: warning: Function parameter or member 'sk_backlog.len' not described in 'sock'
include/net/sock.h:487: warning: Function parameter or member 'sk_backlog.head' not described in 'sock'
include/net/sock.h:487: warning: Function parameter or member 'sk_backlog.tail' not described in 'sock'
include/net/sock.h:487: warning: Function parameter or member 'sk_wq_raw' not described in 'sock'
include/net/sock.h:487: warning: Function parameter or member 'tcp_rtx_queue' not described in 'sock' include/linux/netdevice.h:1940: warning: Function parameter or member 'adj_list.upper' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'adj_list.lower' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'gso_partial_features' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'switchdev_ops' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'l3mdev_ops' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'xfrmdev_ops' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'name_assign_type' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'ieee802154_ptr' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'mpls_ptr' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'xdp_prog' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'gro_flush_timeout' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'nf_hooks_ingress' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member '____cacheline_aligned_in_smp' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'qdisc_hash' not described in 'net_device' include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising' not described in 'phylink_link_state' include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising' not described in 'phylink_link_state' include/linux/rcupdate.h:570: ERROR: Unexpected indentation.
include/linux/rcupdate.h:574: ERROR: Unexpected indentation.
include/linux/rcupdate.h:578: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/rcupdate.h:580: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/rcupdate.h:580: WARNING: Inline literal start-string without end-string.
kernel/time/timer.c:1259: ERROR: Unexpected indentation.
kernel/time/timer.c:1261: ERROR: Unexpected indentation.
kernel/time/timer.c:1262: WARNING: Block quote ends without a blank line; unexpected unindent.
include/linux/wait.h:110: WARNING: Block quote ends without a blank line; unexpected unindent.
include/linux/wait.h:113: ERROR: Unexpected indentation.
include/linux/wait.h:115: WARNING: Block quote ends without a blank line; unexpected unindent.
kernel/time/hrtimer.c:1113: WARNING: Block quote ends without a blank line; unexpected unindent.
kernel/signal.c:327: WARNING: Inline literal start-string without end-string.
drivers/video/fbdev/core/modedb.c:647: WARNING: Inline strong start-string without end-string. drivers/video/fbdev/core/modedb.c:647: WARNING: Inline strong start-string without end-string. drivers/video/fbdev/core/modedb.c:647: WARNING: Inline strong start-string without end-string. drivers/video/fbdev/core/modedb.c:647: WARNING: Inline strong start-string without end-string.
include/linux/iio/iio.h:191: ERROR: Unexpected indentation.
include/linux/iio/iio.h:192: WARNING: Block quote ends without a blank line; unexpected unindent.
include/linux/iio/iio.h:198: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/ata/libata-core.c:5920: ERROR: Unknown target name: "hw".
drivers/message/fusion/mptbase.c:5052: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/tty/serial/serial_core.c:1901: WARNING: Definition list ends without a blank line; unexpected unindent. include/linux/mtd/rawnand.h:805: ERROR: Unexpected indentation.
include/linux/mtd/rawnand.h:1391: WARNING: Inline strong start-string without end-string.
include/linux/mtd/rawnand.h:1393: WARNING: Inline strong start-string without end-string.
include/linux/regulator/driver.h:273: ERROR: Unknown target name: "regulator_regmap_x_voltage". Documentation/driver-api/slimbus.rst:93: WARNING: Title underline too short.
vim +146 include/drm/drm_plane.h
43968d7b Daniel Vetter 2016-09-21 @146
:::::: The code at line 146 was first introduced by commit :::::: 43968d7b806d7a7e021261294c583a216fddf0e5 drm: Extract drm_plane.[hc]
:::::: TO: Daniel Vetter <[email protected]> :::::: CC: Sean Paul <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/10] drm: Add Plane Degamma properties
In reply to Daniele CastagnaQuoted 138 lines · Daniele Castagna
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Add Plane Degamma as a blob property and plane
degamma size as a range property.(am from https://patchwork.kernel.org/patch/10046515/)
Change-Id: Iaead6f944a8b677227d1be11169f46178de533b1
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_atomic.c | 12 ++++++++++++ drivers/gpu/drm/drm_atomic_helper.c | 7 +++++++ drivers/gpu/drm/drm_mode_config.c | 14 ++++++++++++++ include/drm/drm_mode_config.h | 10 ++++++++++ include/drm/drm_plane.h | 10 ++++++++++ 5 files changed, 53 insertions(+)drivers/gpu/drm/drm_atomic.c +12
-0@@ -717,6 +717,8 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, {struct drm_device *dev = plane->dev;struct drm_mode_config *config = &dev->mode_config; +bool replaced = false; +int ret;if (property == config->prop_fb_id) {struct drm_framebuffer *fb =drm_framebuffer_lookup (dev,NULL , val);@@ -762,6 +764,12 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, }else if (plane->funcs->atomic_set_property) {return plane->funcs->atomic_set_property (plane, state, property, val); + }else if (property == config->plane_degamma_lut_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->degamma_lut, + val,-1 , &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }@@ -820,6 +828,9 @@ drm_atomic_plane_get_property(struct drm_plane *plane, *val = state->zpos; }else if (plane->funcs->atomic_get_property) {return plane->funcs->atomic_get_property (plane, state, property, val); + }else if (property == config->plane_degamma_lut_property) { + *val = (state->degamma_lut) ? + state->degamma_lut->base.id :0 ; }else {return -EINVAL ; }@@ -944,6 +955,7 @@ static void drm_atomic_plane_print_state(struct drm_printer *p,drm_printf (p,"\tcrtc-pos=" DRM_RECT_FMT "\n" ,DRM_RECT_ARG (&dest));drm_printf (p,"\tsrc-pos=" DRM_RECT_FP_FMT "\n" ,DRM_RECT_FP_ARG (&src));drm_printf (p,"\trotation=%x\n" , state->rotation); +drm_printf (p,"\tcolor_mgmt_changed=%d\n" , state->color_mgmt_changed);if (plane->funcs->atomic_print_state) plane->funcs->atomic_print_state (p, state);drivers/gpu/drm/drm_atomic_helper.c +7
-0@@ -3488,7 +3488,12 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,drm_framebuffer_get (state->fb); state->fence =NULL ; + state->commit =NULL ; + +if (state->degamma_lut) +drm_property_reference_blob (state->degamma_lut); + state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);@@ -3533,6 +3538,8 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)if (state->commit)drm_crtc_commit_put (state->commit); + +drm_property_unreference_blob (state->degamma_lut); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);drivers/gpu/drm/drm_mode_config.c +14
-0@@ -348,6 +348,20 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.modifiers_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_DEGAMMA_LUT" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_degamma_lut_property = prop; + + prop =drm_property_create_range (dev, +DRM_MODE_PROP_IMMUTABLE , +"PLANE_DEGAMMA_LUT_SIZE" ,0 ,UINT_MAX ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_degamma_lut_size_property = prop; +return 0 ; }include/drm/drm_mode_config.h +10
-0@@ -724,6 +724,16 @@ struct drm_mode_config {* the degamma LUT as supported by the driver (read-only). */ struct drm_property *degamma_lut_size_property; +/** +* @plane_degamma_lut_property: Optional Plane property to set the LUT +* used to convert the framebuffer's colors to linear gamma. +*/ +struct drm_property *plane_degamma_lut_property; +/** +* @plane_degamma_lut_size_property: Optional Plane property for the +* size of the degamma LUT as supported by the driver (read-only). +*/ +struct drm_property *plane_degamma_lut_size_property;/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the include/drm/drm_plane.h +0
-0
include/drm/drm_plane.h struct drm_plane_state { · line 134
Quoted 4 lines
include/drm/drm_plane.h +1
-0@@ -131,7 +131,17 @@ struct drm_plane_state {*/ struct drm_crtc_commit *commit; +/* @degamma_lut:
This isn't kerneldoc. Please build the docs using
$ make htmldocs
and make sure it's warning-free (for the files you're touching) and that the end result looks correct and has all the hyperlinks working and linking to the right places.
Thanks, Daniel
Quoted 20 lines
include/drm/drm_plane.h +9
-0+* +* Lookup table for converting framebuffer pixel data before apply the +* color conversion matrix @ctm. See drm_plane_enable_color_mgmt(). The +* blob (if not NULL) is an array of &struct drm_color_lut. +*/ +struct drm_property_blob *degamma_lut; +struct drm_atomic_state *state; + + bool color_mgmt_changed : 1; }; static inline struct drm_rectSignature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/10] drm: Add Plane Degamma properties
In reply to Daniele CastagnaQuoted 6 lines · Daniele Castagna
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Add Plane Degamma as a blob property and plane
degamma size as a range property.
The discussion on this previous version has some feedback on using 32-bit values in the gamma lut instead of 16-bit. Have you considered this?
Quoted 60 lines
Change-Id: Iaead6f944a8b677227d1be11169f46178de533b1
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_atomic.c | 12 ++++++++++++ drivers/gpu/drm/drm_atomic_helper.c | 7 +++++++ drivers/gpu/drm/drm_mode_config.c | 14 ++++++++++++++ include/drm/drm_mode_config.h | 10 ++++++++++ include/drm/drm_plane.h | 10 ++++++++++ 5 files changed, 53 insertions(+)drivers/gpu/drm/drm_atomic.c +12
-0@@ -717,6 +717,8 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, {struct drm_device *dev = plane->dev;struct drm_mode_config *config = &dev->mode_config; +bool replaced = false; +int ret;if (property == config->prop_fb_id) {struct drm_framebuffer *fb =drm_framebuffer_lookup (dev,NULL , val);@@ -762,6 +764,12 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, }else if (plane->funcs->atomic_set_property) {return plane->funcs->atomic_set_property (plane, state, property, val); + }else if (property == config->plane_degamma_lut_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->degamma_lut, + val,-1 , &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }@@ -820,6 +828,9 @@ drm_atomic_plane_get_property(struct drm_plane *plane, *val = state->zpos; }else if (plane->funcs->atomic_get_property) {return plane->funcs->atomic_get_property (plane, state, property, val); + }else if (property == config->plane_degamma_lut_property) { + *val = (state->degamma_lut) ? + state->degamma_lut->base.id :0 ; }else {return -EINVAL ; }@@ -944,6 +955,7 @@ static void drm_atomic_plane_print_state(struct drm_printer *p,drm_printf (p,"\tcrtc-pos=" DRM_RECT_FMT "\n" ,DRM_RECT_ARG (&dest));drm_printf (p,"\tsrc-pos=" DRM_RECT_FP_FMT "\n" ,DRM_RECT_FP_ARG (&src));drm_printf (p,"\trotation=%x\n" , state->rotation); +drm_printf (p,"\tcolor_mgmt_changed=%d\n" , state->color_mgmt_changed);if (plane->funcs->atomic_print_state) plane->funcs->atomic_print_state (p, state);drivers/gpu/drm/drm_atomic_helper.c +0
-0
drivers/gpu/drm/drm_atomic_helper.c void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane, · line 3491
Quoted 4 lines
drivers/gpu/drm/drm_atomic_helper.c +1
-0@@ -3488,7 +3488,12 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,drm_framebuffer_get (state->fb); state->fence =NULL ; +
Extra line snuck in here
Quoted 28 lines
drivers/gpu/drm/drm_atomic_helper.c +6
-0state->commit =NULL ; + +if (state->degamma_lut) +drm_property_reference_blob (state->degamma_lut); + state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);@@ -3533,6 +3538,8 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)if (state->commit)drm_crtc_commit_put (state->commit); + +drm_property_unreference_blob (state->degamma_lut); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);drivers/gpu/drm/drm_mode_config.c +3
-0@@ -348,6 +348,20 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.modifiers_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_DEGAMMA_LUT" ,0 );
drivers/gpu/drm/drm_mode_config.c static int drm_mode_create_standard_properties(struct drm_device *dev) · line 363
Quoted 10 lines
drivers/gpu/drm/drm_mode_config.c +10
-0+if (!prop) +return -ENOMEM ; + dev->mode_config.plane_degamma_lut_property = prop; + + prop =drm_property_create_range (dev, +DRM_MODE_PROP_IMMUTABLE , +"PLANE_DEGAMMA_LUT_SIZE" ,0 ,UINT_MAX ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_degamma_lut_size_property = prop;
Since these are optional, we probably want a helper for them which is only called if a plane wants to use them instead of always instantiating them.
Quoted 12 lines
drivers/gpu/drm/drm_mode_config.c +1
-0+return 0 ; }include/drm/drm_mode_config.h +0
-0@@ -724,6 +724,16 @@ struct drm_mode_config {* the degamma LUT as supported by the driver (read-only). */ struct drm_property *degamma_lut_size_property;
include/drm/drm_mode_config.h struct drm_mode_config { · line 736
Quoted 10 lines
include/drm/drm_mode_config.h +10
-0+/** +* @plane_degamma_lut_property: Optional Plane property to set the LUT +* used to convert the framebuffer's colors to linear gamma. +*/ +struct drm_property *plane_degamma_lut_property; +/** +* @plane_degamma_lut_size_property: Optional Plane property for the +* size of the degamma LUT as supported by the driver (read-only). +*/ +struct drm_property *plane_degamma_lut_size_property;
Can we put these in drm_plane instead? If we do, we don't need the "plane_" prefix.
Quoted 32 lines
include/drm/drm_mode_config.h +0
-0/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the include/drm/drm_plane.h +10
-0@@ -131,7 +131,17 @@ struct drm_plane_state {*/ struct drm_crtc_commit *commit; +/* @degamma_lut: +* +* Lookup table for converting framebuffer pixel data before apply the +* color conversion matrix @ctm. See drm_plane_enable_color_mgmt(). The +* blob (if not NULL) is an array of &struct drm_color_lut. +*/ +struct drm_property_blob *degamma_lut; +struct drm_atomic_state *state; + + bool color_mgmt_changed : 1; }; static inline struct drm_rectSignature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RE: [PATCH 02/10] drm: Add Plane Degamma properties
Quoted 13 lines
-----Original Message-----
From: Sean Paul [mailto:[email protected]]
Sent: Tuesday, February 27, 2018 8:44 PM
To: Daniele Castagna <[email protected]>
Cc: [email protected]; [email protected]; Shankar, Uma <[email protected]>
Subject: Re: [PATCH 02/10] drm: Add Plane Degamma propertiesQuoted 2 lines · Daniele Castagna
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Quoted 8 lines
Quoted 4 lines
Add Plane Degamma as a blob property and plane degamma size as a range property.
The discussion on this previous version has some feedback on using 32-bit values in the gamma lut instead of 16-bit. Have you considered this?
This needs to be modified. Will address this and send a next version. Kept it on hold since was trying to get a userspace implementation done. But, it's good to refresh the series addressing all the review comments. Thanks for the review Sean Paul.
Quoted 72 lines
Quoted 17 lines
Change-Id: Iaead6f944a8b677227d1be11169f46178de533b1
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_atomic.c | 12 ++++++++++++ drivers/gpu/drm/drm_atomic_helper.c | 7 +++++++ drivers/gpu/drm/drm_mode_config.c | 14 ++++++++++++++ include/drm/drm_mode_config.h | 10 ++++++++++ include/drm/drm_plane.h | 10 ++++++++++ 5 files changed, 53 insertions(+)(quoted diff) +0
-0
b/drivers/gpu/drm/drm_atomic.cindexb76d49218cf1d..4a06ff2fd1a5e100644drivers/gpu/drm/drm_atomic.c static int drm_atomic_plane_set_property(struct · line 724
Quoted 8 lines
drivers/gpu/drm/drm_atomic.c +2
-0@@ -717,6 +717,8 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, {struct drm_device *dev = plane->dev;struct drm_mode_config *config = &dev->mode_config; +bool replaced = false; +int ret;if (property == config->prop_fb_id) { struct drm_framebuffer *fb = drm_framebuffer_lookup(dev,NULL,
Quoted 1 line
val); @@ -762,6 +764,12 @@ static int drm_atomic_plane_set_property(struct
drm_plane*plane,drivers/gpu/drm/drm_atomic.c drm_atomic_plane_get_property(struct drm_plane
Quoted 13 lines
drivers/gpu/drm/drm_atomic.c +6
-0}else if (plane->funcs->atomic_set_property) {return plane->funcs->atomic_set_property (plane, state, property, val); + }else if (property == config->plane_degamma_lut_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->degamma_lut, + val,-1 , &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }@@ -820,6 +828,9 @@ drm_atomic_plane_get_property(struct drm_plane*plane,
drivers/gpu/drm/drm_atomic.c drm_atomic_plane_get_property(struct drm_plane *plane,
Quoted 3 lines
drivers/gpu/drm/drm_atomic.c +0
-0*val = state->zpos; }else if (plane->funcs->atomic_get_property) { return plane->funcs->atomic_get_property(plane, state,property,
drivers/gpu/drm/drm_atomic.c static void drm_atomic_plane_print_state(struct
Quoted 8 lines
drivers/gpu/drm/drm_atomic.c +3
-0val); + }else if (property == config->plane_degamma_lut_property) { + *val = (state->degamma_lut) ? + state->degamma_lut->base.id :0 ; }else {return -EINVAL ;drivers/gpu/drm/drm_atomic.c +0
-0}@@ -944,6 +955,7 @@ static void drm_atomic_plane_print_state(struct
drm_printer*p,drivers/gpu/drm/drm_atomic.c static void drm_atomic_plane_print_state(struct · line 955
Quoted 1 line
drivers/gpu/drm/drm_atomic.c +0
-0drm_printf(p, "\tcrtc-pos=" DRM_RECT_FMT "\n",
DRM_RECT_ARG(&dest));drivers/gpu/drm/drm_atomic.c static void drm_atomic_plane_print_state(struct · line 956
Quoted 1 line
drivers/gpu/drm/drm_atomic.c +0
-0drm_printf(p, "\tsrc-pos=" DRM_RECT_FP_FMT "\n",
DRM_RECT_FP_ARG(&src));drivers/gpu/drm/drm_atomic_helper.c void
Quoted 12 lines
drivers/gpu/drm/drm_atomic.c +2
-0drm_printf (p,"\trotation=%x\n" , state->rotation); +drm_printf (p,"\tcolor_mgmt_changed=%d\n" , +state->color_mgmt_changed);if (plane->funcs->atomic_print_state) plane->funcs->atomic_print_state(p, state); diff --git
a/drivers/gpu/drm/drm_atomic_helper.cb/drivers/gpu/drm/drm_atomic_helper.c
indexab4032167094c..d3eaf4d397681100644drivers/gpu/drm/drm_atomic_helper.c +0
-0@@ -3488,7 +3488,12 @@ void__drm_atomic_helper_plane_duplicate_state(struct
drm_plane*plane,
Quoted 7 lines
drivers/gpu/drm/drm_atomic_helper.c void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane, · line 3491
Quoted 4 lines
drivers/gpu/drm/drm_atomic_helper.c +1
-0drm_framebuffer_get (state->fb); state->fence =NULL ; +Extra line snuck in here
Will rectify this.
Quoted 28 lines
drivers/gpu/drm/drm_mode_config.c static int
Quoted 24 lines
drivers/gpu/drm/drm_atomic_helper.c +6
-0state->commit =NULL ; + +if (state->degamma_lut) +drm_property_reference_blob (state->degamma_lut); + state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);@@ -3533,6 +3538,8 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state) if (state->commit) drm_crtc_commit_put(state->commit); + +drm_property_unreference_blob (state->degamma_lut); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);drivers/gpu/drm/drm_mode_config.c +0
-0@@ -348,6 +348,20 @@ static int
drm_mode_create_standard_properties(struct drm_device *dev)Quoted 3 lines
drivers/gpu/drm/drm_mode_config.c +0
-0return -ENOMEM ; dev->mode_config.modifiers_property = prop;
Quoted 17 lines
drivers/gpu/drm/drm_mode_config.c static int drm_mode_create_standard_properties(struct drm_device *dev) · line 363
Quoted 13 lines
drivers/gpu/drm/drm_mode_config.c +13
-0+ prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_DEGAMMA_LUT" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_degamma_lut_property = prop; + + prop =drm_property_create_range (dev, +DRM_MODE_PROP_IMMUTABLE , +"PLANE_DEGAMMA_LUT_SIZE" ,0 ,UINT_MAX ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_degamma_lut_size_property = prop;Since these are optional, we probably want a helper for them which is only called if a plane wants to use them instead of always instantiating them.
Ok, will update this.
Quoted 16 lines
Quoted 10 lines
drivers/gpu/drm/drm_mode_config.c +1
-0+return 0 ; }(quoted diff) +0
-0
b/include/drm/drm_mode_config.hindex2cb6f02df64ab..dcec93d062b4d100644include/drm/drm_mode_config.h struct drm_mode_config { · line 728
Quoted 5 lines
include/drm/drm_mode_config.h +2
-0@@ -724,6 +724,16 @@ struct drm_mode_config {* the degamma LUT as supported by the driver (read-only). */ struct drm_property *degamma_lut_size_property; +/** +* @plane_degamma_lut_property: Optional Plane property to set the LUT
Quoted 12 lines
include/drm/drm_mode_config.h struct drm_mode_config { · line 736
Quoted 8 lines
include/drm/drm_mode_config.h +8
-0+* used to convert the framebuffer's colors to linear gamma. +*/ +struct drm_property *plane_degamma_lut_property; +/** +* @plane_degamma_lut_size_property: Optional Plane property for the +* size of the degamma LUT as supported by the driver (read-only). +*/ +struct drm_property *plane_degamma_lut_size_property;Can we put these in
drm_planeinstead? If we do, we don't need the "plane_" prefix.
Yeah, will do that.
Quoted 29 lines
Quoted 8 lines
include/drm/drm_mode_config.h +0
-0/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the diff --git
a/include/drm/drm_plane.hb/include/drm/drm_plane.hindex8185e3468a231..2f8f5db77a406100644include/drm/drm_plane.h struct drm_plane_state { · line 137
Quoted 7 lines
include/drm/drm_plane.h +4
-0@@ -131,7 +131,17 @@ struct drm_plane_state {*/ struct drm_crtc_commit *commit; +/* @degamma_lut: +* +* Lookup table for converting framebuffer pixel data before apply the +* color conversion matrix @ctm. See drm_plane_enable_color_mgmt(). The
Quoted 13 lines
include/drm/drm_plane.h +6
-1+* blob (if not NULL) is an array of &struct drm_color_lut. +*/ +struct drm_property_blob *degamma_lut; +struct drm_atomic_state *state; + + bool color_mgmt_changed : 1; }; static inline struct drm_rect --2.16.1.291.g4437f3f132-goog
Quoted 7 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/10 drm: Add Plane CTM property
In reply to Daniele CastagnaFrom: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Add a blob property for plane CSC usage.
(am from https://patchwork.kernel.org/patch/9971339/)
Change-Id: I688ce7c95c20d307cb0aa35c5eba5ce2e1e88314
Signed-off-by: Uma Shankar <uma.shankar at intel.com>
--- drivers/gpu/drm/drm_atomic.c | 10 ++++++++++ drivers/gpu/drm/drm_atomic_helper.c | 3 +++ drivers/gpu/drm/drm_mode_config.c | 6 ++++++ include/drm/drm_mode_config.h | 6 ++++++ include/drm/drm_plane.h | 8 ++++++++ 5 files changed, 33 insertions(+)
drivers/gpu/drm/drm_atomic.c +10 -0
@@ -770,6 +770,14 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, val, -1, &replaced); state->color_mgmt_changed |= replaced;return ret; + }else if (property == config->plane_ctm_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->ctm, + val, +sizeof (struct drm_color_ctm ), + &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }
@@ -831,6 +839,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane, }else if (property == config->plane_degamma_lut_property) { *val = (state->degamma_lut) ? state->degamma_lut->base.id :0 ; + }else if (property == config->plane_ctm_property) { + *val = (state->ctm) ? state->ctm->base.id :0 ; }else {return -EINVAL ; }
drivers/gpu/drm/drm_atomic_helper.c +3 -0
@@ -3493,6 +3493,8 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,if (state->degamma_lut)drm_property_reference_blob (state->degamma_lut); +if (state->ctm) +drm_property_reference_blob (state->ctm); state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);
@@ -3540,6 +3542,7 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)drm_crtc_commit_put (state->commit);drm_property_unreference_blob (state->degamma_lut); +drm_property_unreference_blob (state->ctm); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);
drivers/gpu/drm/drm_mode_config.c +6 -0
@@ -361,6 +361,12 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)if (!prop)return -ENOMEM ; dev->mode_config.plane_degamma_lut_size_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_CTM" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_ctm_property = prop;return 0 ; }
include/drm/drm_mode_config.h +6 -0
@@ -734,6 +734,12 @@ struct drm_mode_config {* size of the degamma LUT as supported by the driver (read-only). */ struct drm_property *plane_degamma_lut_size_property; +/** +* @plane_ctm_property: Optional CRTC property to set the +* matrix used to convert colors after the lookup in the +* degamma LUT. +*/ +struct drm_property *plane_ctm_property;/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the
include/drm/drm_plane.h +8 -0
@@ -139,6 +139,14 @@ struct drm_plane_state {*/ struct drm_property_blob *degamma_lut; +/** +* @ctm: +* +* Color transformation matrix. See drm_plane_enable_color_mgmt(). The +* blob (if not NULL) is a &struct drm_color_ctm. +*/ +struct drm_property_blob *ctm; +struct drm_atomic_state *state; bool color_mgmt_changed : 1;
Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 03/10] drm: Add Plane CTM property
Quoted 87 lines · Daniele Castagna
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Add a blob property for plane CSC usage.
(am from https://patchwork.kernel.org/patch/9971339/)
Change-Id: I688ce7c95c20d307cb0aa35c5eba5ce2e1e88314
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_atomic.c | 10 ++++++++++ drivers/gpu/drm/drm_atomic_helper.c | 3 +++ drivers/gpu/drm/drm_mode_config.c | 6 ++++++ include/drm/drm_mode_config.h | 6 ++++++ include/drm/drm_plane.h | 8 ++++++++ 5 files changed, 33 insertions(+)drivers/gpu/drm/drm_atomic.c +10
-0@@ -770,6 +770,14 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, val, -1, &replaced); state->color_mgmt_changed |= replaced;return ret; + }else if (property == config->plane_ctm_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->ctm, + val, +sizeof (struct drm_color_ctm ), + &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }@@ -831,6 +839,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane, }else if (property == config->plane_degamma_lut_property) { *val = (state->degamma_lut) ? state->degamma_lut->base.id :0 ; + }else if (property == config->plane_ctm_property) { + *val = (state->ctm) ? state->ctm->base.id :0 ; }else {return -EINVAL ; }drivers/gpu/drm/drm_atomic_helper.c +3
-0@@ -3493,6 +3493,8 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,if (state->degamma_lut)drm_property_reference_blob (state->degamma_lut); +if (state->ctm) +drm_property_reference_blob (state->ctm); state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);@@ -3540,6 +3542,7 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)drm_crtc_commit_put (state->commit);drm_property_unreference_blob (state->degamma_lut); +drm_property_unreference_blob (state->ctm); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);drivers/gpu/drm/drm_mode_config.c +6
-0@@ -361,6 +361,12 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)if (!prop)return -ENOMEM ; dev->mode_config.plane_degamma_lut_size_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_CTM" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_ctm_property = prop;return 0 ; }include/drm/drm_mode_config.h +0
-0
include/drm/drm_mode_config.h struct drm_mode_config { · line 742
Quoted 9 lines
include/drm/drm_mode_config.h +6
-0@@ -734,6 +734,12 @@ struct drm_mode_config {* size of the degamma LUT as supported by the driver (read-only). */ struct drm_property *plane_degamma_lut_size_property; +/** +* @plane_ctm_property: Optional CRTC property to set the +* matrix used to convert colors after the lookup in the +* degamma LUT. +*/ +struct drm_property *plane_ctm_property;
Same comments re: puttting the property in drm_plane and adding a helper to create it.
Sean
Quoted 29 lines
include/drm/drm_mode_config.h +0
-0/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the include/drm/drm_plane.h +8
-0@@ -139,6 +139,14 @@ struct drm_plane_state {*/ struct drm_property_blob *degamma_lut; +/** +* @ctm: +* +* Color transformation matrix. See drm_plane_enable_color_mgmt(). The +* blob (if not NULL) is a &struct drm_color_ctm. +*/ +struct drm_property_blob *ctm; +struct drm_atomic_state *state; bool color_mgmt_changed : 1;Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RE: [PATCH 03/10] drm: Add Plane CTM property
Quoted 111 lines
-----Original Message-----
From: dri-devel [mailto:[email protected]] On Behalf Of Sean Paul
Sent: Tuesday, February 27, 2018 8:53 PM
To: Daniele Castagna <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 03/10] drm: Add Plane CTM propertydrivers/gpu/drm/drm_atomic.c static int drm_atomic_plane_set_property(struct
Quoted 22 lines · Daniele Castagna
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Add a blob property for plane CSC usage.
(am from https://patchwork.kernel.org/patch/9971339/)
Change-Id: I688ce7c95c20d307cb0aa35c5eba5ce2e1e88314
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_atomic.c | 10 ++++++++++ drivers/gpu/drm/drm_atomic_helper.c | 3 +++ drivers/gpu/drm/drm_mode_config.c | 6 ++++++ include/drm/drm_mode_config.h | 6 ++++++ include/drm/drm_plane.h | 8 ++++++++ 5 files changed, 33 insertions(+)(quoted diff) +0
-0
b/drivers/gpu/drm/drm_atomic.cindex4a06ff2fd1a5e..d4b8c6cc84128100644drivers/gpu/drm/drm_atomic.c +0
-0@@ -770,6 +770,14 @@ static int drm_atomic_plane_set_property(struct
drm_plane*plane,drivers/gpu/drm/drm_atomic.c drm_atomic_plane_get_property(struct drm_plane
Quoted 15 lines
drivers/gpu/drm/drm_atomic.c +8
-0val, -1, &replaced); state->color_mgmt_changed |= replaced;return ret; + }else if (property == config->plane_ctm_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->ctm, + val, +sizeof (struct drm_color_ctm ), + &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }@@ -831,6 +839,8 @@ drm_atomic_plane_get_property(struct drm_plane*plane,
drivers/gpu/drm/drm_atomic_helper.c void
Quoted 24 lines
drivers/gpu/drm/drm_atomic.c +2
-0}else if (property == config->plane_degamma_lut_property) { *val = (state->degamma_lut) ? state->degamma_lut->base.id :0 ; + }else if (property == config->plane_ctm_property) { + *val = (state->ctm) ? state->ctm->base.id :0 ; }else {return -EINVAL ; }drivers/gpu/drm/drm_atomic_helper.c +2
-0@@ -3493,6 +3493,8 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane, if (state->degamma_lut) drm_property_reference_blob(state->degamma_lut); +if (state->ctm) +drm_property_reference_blob (state->ctm); state->color_mgmt_changed = false; }
EXPORT_SYMBOL(__drm_atomic_helper_plane_duplicate_state);drivers/gpu/drm/drm_atomic_helper.c +0
-0@@ -3540,6 +3542,7 @@ void
__drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)drivers/gpu/drm/drm_mode_config.c static int
Quoted 13 lines
drivers/gpu/drm/drm_atomic_helper.c +1
-0drm_crtc_commit_put (state->commit);drm_property_unreference_blob (state->degamma_lut); +drm_property_unreference_blob (state->ctm); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);drivers/gpu/drm/drm_mode_config.c +0
-0@@ -361,6 +361,12 @@ static int
drm_mode_create_standard_properties(struct drm_device *dev)Quoted 22 lines
drivers/gpu/drm/drm_mode_config.c +6
-0if (!prop)return -ENOMEM ; dev->mode_config.plane_degamma_lut_size_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_CTM" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_ctm_property = prop;return 0 ; }(quoted diff) +0
-0
b/include/drm/drm_mode_config.hindexdcec93d062b4d..ad7235ced531b100644include/drm/drm_mode_config.h +1
-0@@ -734,6 +734,12 @@ struct drm_mode_config {* size of the degamma LUT as supported by the driver (read-only). */ struct drm_property *plane_degamma_lut_size_property; +/**
Quoted 9 lines
include/drm/drm_mode_config.h struct drm_mode_config { · line 742
Quoted 5 lines
include/drm/drm_mode_config.h +5
-0+* @plane_ctm_property: Optional CRTC property to set the +* matrix used to convert colors after the lookup in the +* degamma LUT. +*/ +struct drm_property *plane_ctm_property;Same comments re: puttting the property in
drm_planeand adding a helper to create it.
Sure, will update this.
Regards,
Uma Shankar
Quoted 28 lines
Sean
Quoted 8 lines
include/drm/drm_mode_config.h +0
-0/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the diff --git
a/include/drm/drm_plane.hb/include/drm/drm_plane.hindex2f8f5db77a406..21aecc9c91a09100644include/drm/drm_plane.h struct drm_plane_state { · line 145
Quoted 7 lines
include/drm/drm_plane.h +4
-0@@ -139,6 +139,14 @@ struct drm_plane_state {*/ struct drm_property_blob *degamma_lut; +/** +* @ctm: +* +* Color transformation matrix. See drm_plane_enable_color_mgmt(). The
Quoted 10 lines
include/drm/drm_plane.h +4
-1+* blob (if not NULL) is a &struct drm_color_ctm. +*/ +struct drm_property_blob *ctm; +struct drm_atomic_state *state; bool color_mgmt_changed : 1; --2.16.1.291.g4437f3f132-goog
Quoted 11 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/10 drm: Add Plane Gamma properties
In reply to Daniele CastagnaFrom: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Add plane gamma as blob property and size as a
range property.
(am from https://patchwork.kernel.org/patch/9971325/)
Change-Id: I606cd40c9748b136fc2bf4750bea1da285add62d
Signed-off-by: Uma Shankar <uma.shankar at intel.com>
--- drivers/gpu/drm/drm_atomic.c | 8 ++++++++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ drivers/gpu/drm/drm_mode_config.c | 14 ++++++++++++++ include/drm/drm_mode_config.h | 11 +++++++++++ include/drm/drm_plane.h | 9 +++++++++ 5 files changed, 46 insertions(+)
drivers/gpu/drm/drm_atomic.c +8 -0
@@ -778,6 +778,12 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, &replaced); state->color_mgmt_changed |= replaced;return ret; + }else if (property == config->plane_gamma_lut_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->gamma_lut, + val,-1 , &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }
@@ -841,6 +847,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane, state->degamma_lut->base.id : 0; }else if (property == config->plane_ctm_property) { *val = (state->ctm) ? state->ctm->base.id :0 ; + }else if (property == config->plane_gamma_lut_property) { + *val = (state->gamma_lut) ? state->gamma_lut->base.id :0 ; }else {return -EINVAL ; }
drivers/gpu/drm/drm_atomic_helper.c +4 -0
@@ -3495,6 +3495,9 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,drm_property_reference_blob (state->degamma_lut);if (state->ctm)drm_property_reference_blob (state->ctm); +if (state->gamma_lut) +drm_property_reference_blob (state->gamma_lut); + state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);
@@ -3543,6 +3546,7 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)drm_property_unreference_blob (state->degamma_lut);drm_property_unreference_blob (state->ctm); +drm_property_unreference_blob (state->gamma_lut); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);
drivers/gpu/drm/drm_mode_config.c +14 -0
@@ -368,6 +368,20 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.plane_ctm_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_GAMMA_LUT" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_property = prop; + + prop =drm_property_create_range (dev, +DRM_MODE_PROP_IMMUTABLE , +"PLANE_GAMMA_LUT_SIZE" ,0 ,UINT_MAX ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_size_property = prop; +return 0 ; }
include/drm/drm_mode_config.h +11 -0
@@ -740,6 +740,17 @@ struct drm_mode_config {* degamma LUT. */ struct drm_property *plane_ctm_property; +/** +* @plane_gamma_lut_property: Optional Plane property to set the LUT +* used to convert the colors, after the CTM matrix, to the common +* gamma space chosen for blending. +*/ +struct drm_property *plane_gamma_lut_property; +/** +* @plane_gamma_lut_size_property: Optional Plane property for the size +* of the gamma LUT as supported by the driver (read-only). +*/ +struct drm_property *plane_gamma_lut_size_property;/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the
include/drm/drm_plane.h +9 -0
@@ -147,6 +147,15 @@ struct drm_plane_state {*/ struct drm_property_blob *ctm; +/** +* @gamma_lut: +* +* Lookup table for converting pixel data after the color conversion +* matrix @ctm. See drm_plane_enable_color_mgmt(). The blob (if not +* NULL) is an array of &struct drm_color_lut. +*/ +struct drm_property_blob *gamma_lut; +struct drm_atomic_state *state; bool color_mgmt_changed : 1;
Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/10] drm: Add Plane Gamma properties
Quoted 5 lines · Daniele Castagna
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Add plane gamma as blob property and size as a
range property.
Plane degamma & CTM make sense to me but I'm not sure why gamma would be on a per-plane basis. That said, HW sometimes has these implemented in odd ways. Do we know of any HW that will currently or in the future need per-plane gamma or are we just trying to cover all potentialities?
Harry
Quoted 118 lines
(am from https://patchwork.kernel.org/patch/9971325/)
Change-Id: I606cd40c9748b136fc2bf4750bea1da285add62d
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_atomic.c | 8 ++++++++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ drivers/gpu/drm/drm_mode_config.c | 14 ++++++++++++++ include/drm/drm_mode_config.h | 11 +++++++++++ include/drm/drm_plane.h | 9 +++++++++ 5 files changed, 46 insertions(+)drivers/gpu/drm/drm_atomic.c +8
-0@@ -778,6 +778,12 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, &replaced); state->color_mgmt_changed |= replaced;return ret; + }else if (property == config->plane_gamma_lut_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->gamma_lut, + val,-1 , &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }@@ -841,6 +847,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane, state->degamma_lut->base.id : 0; }else if (property == config->plane_ctm_property) { *val = (state->ctm) ? state->ctm->base.id :0 ; + }else if (property == config->plane_gamma_lut_property) { + *val = (state->gamma_lut) ? state->gamma_lut->base.id :0 ; }else {return -EINVAL ; }drivers/gpu/drm/drm_atomic_helper.c +4
-0@@ -3495,6 +3495,9 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,drm_property_reference_blob (state->degamma_lut);if (state->ctm)drm_property_reference_blob (state->ctm); +if (state->gamma_lut) +drm_property_reference_blob (state->gamma_lut); + state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);@@ -3543,6 +3546,7 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)drm_property_unreference_blob (state->degamma_lut);drm_property_unreference_blob (state->ctm); +drm_property_unreference_blob (state->gamma_lut); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);drivers/gpu/drm/drm_mode_config.c +14
-0@@ -368,6 +368,20 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.plane_ctm_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_GAMMA_LUT" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_property = prop; + + prop =drm_property_create_range (dev, +DRM_MODE_PROP_IMMUTABLE , +"PLANE_GAMMA_LUT_SIZE" ,0 ,UINT_MAX ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_size_property = prop; +return 0 ; }include/drm/drm_mode_config.h +11
-0@@ -740,6 +740,17 @@ struct drm_mode_config {* degamma LUT. */ struct drm_property *plane_ctm_property; +/** +* @plane_gamma_lut_property: Optional Plane property to set the LUT +* used to convert the colors, after the CTM matrix, to the common +* gamma space chosen for blending. +*/ +struct drm_property *plane_gamma_lut_property; +/** +* @plane_gamma_lut_size_property: Optional Plane property for the size +* of the gamma LUT as supported by the driver (read-only). +*/ +struct drm_property *plane_gamma_lut_size_property;/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the include/drm/drm_plane.h +2
-0@@ -147,6 +147,15 @@ struct drm_plane_state {*/ struct drm_property_blob *ctm; +/** +* @gamma_lut:
include/drm/drm_plane.h struct drm_plane_state { · line 161
Quoted 10 lines
include/drm/drm_plane.h +7
-0+* +* Lookup table for converting pixel data after the color conversion +* matrix @ctm. See drm_plane_enable_color_mgmt(). The blob (if not +* NULL) is an array of &struct drm_color_lut. +*/ +struct drm_property_blob *gamma_lut; +struct drm_atomic_state *state; bool color_mgmt_changed : 1;
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/10] drm: Add Plane Gamma properties
rk3399 has the option of setting per-plane gamma.
The YUV2YUV registers are per-plane. Each plane YUV2YUV pipeline has at least 3 optional stages, two of those being degamma and gamma, and they can be configured per-plane.
I'm not sure about Intel HW. I think they might have something similar planned, considering the original patch was from uma.shankar. CCing directly in case he knows more.
Quoted 137 lines · Harry Wentland
Quoted 5 lines · Daniele Castagna
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Add plane gamma as blob property and size as a
range property.Plane degamma & CTM make sense to me but I'm not sure why gamma would be on a per-plane basis. That said, HW sometimes has these implemented in odd ways. Do we know of any HW that will currently or in the future need per-plane gamma or are we just trying to cover all potentialities?
Harry
Quoted 126 lines
(am from https://patchwork.kernel.org/patch/9971325/)
Change-Id: I606cd40c9748b136fc2bf4750bea1da285add62d
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_atomic.c | 8 ++++++++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ drivers/gpu/drm/drm_mode_config.c | 14 ++++++++++++++ include/drm/drm_mode_config.h | 11 +++++++++++ include/drm/drm_plane.h | 9 +++++++++ 5 files changed, 46 insertions(+)drivers/gpu/drm/drm_atomic.c +8
-0@@ -778,6 +778,12 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, &replaced); state->color_mgmt_changed |= replaced;return ret; + }else if (property == config->plane_gamma_lut_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->gamma_lut, + val,-1 , &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }@@ -841,6 +847,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane, state->degamma_lut->base.id : 0; }else if (property == config->plane_ctm_property) { *val = (state->ctm) ? state->ctm->base.id :0 ; + }else if (property == config->plane_gamma_lut_property) { + *val = (state->gamma_lut) ? state->gamma_lut->base.id :0 ; }else {return -EINVAL ; }drivers/gpu/drm/drm_atomic_helper.c +4
-0@@ -3495,6 +3495,9 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,drm_property_reference_blob (state->degamma_lut);if (state->ctm)drm_property_reference_blob (state->ctm); +if (state->gamma_lut) +drm_property_reference_blob (state->gamma_lut); + state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);@@ -3543,6 +3546,7 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)drm_property_unreference_blob (state->degamma_lut);drm_property_unreference_blob (state->ctm); +drm_property_unreference_blob (state->gamma_lut); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);drivers/gpu/drm/drm_mode_config.c +14
-0@@ -368,6 +368,20 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.plane_ctm_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_GAMMA_LUT" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_property = prop; + + prop =drm_property_create_range (dev, +DRM_MODE_PROP_IMMUTABLE , +"PLANE_GAMMA_LUT_SIZE" ,0 ,UINT_MAX ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_size_property = prop; +return 0 ; }include/drm/drm_mode_config.h +11
-0@@ -740,6 +740,17 @@ struct drm_mode_config {* degamma LUT. */ struct drm_property *plane_ctm_property; +/** +* @plane_gamma_lut_property: Optional Plane property to set the LUT +* used to convert the colors, after the CTM matrix, to the common +* gamma space chosen for blending. +*/ +struct drm_property *plane_gamma_lut_property; +/** +* @plane_gamma_lut_size_property: Optional Plane property for the size +* of the gamma LUT as supported by the driver (read-only). +*/ +struct drm_property *plane_gamma_lut_size_property;/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the include/drm/drm_plane.h +9
-0@@ -147,6 +147,15 @@ struct drm_plane_state {*/ struct drm_property_blob *ctm; +/** +* @gamma_lut: +* +* Lookup table for converting pixel data after the color conversion +* matrix @ctm. See drm_plane_enable_color_mgmt(). The blob (if not +* NULL) is an array of &struct drm_color_lut. +*/ +struct drm_property_blob *gamma_lut; +struct drm_atomic_state *state;
Quoted 2 lines
include/drm/drm_plane.h struct drm_plane_state { · line 161
Quoted 2 lines
include/drm/drm_plane.h +0
-0bool color_mgmt_changed : 1;
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/10] drm: Add Plane Gamma properties
Quoted 8 lines · Daniele Castagna
rk3399 has the option of setting per-plane gamma.
The YUV2YUV registers are per-plane. Each plane YUV2YUV pipeline has at least 3 optional stages, two of those being degamma and gamma, and they can be configured per-plane.I'm not sure about Intel HW. I think they might have something similar planned, considering the original patch was from uma.shankar. CCing directly in case he knows more.
IIRC some of out upcoming stuff will have a pipeline like 'csc->degamma->csc->gamma->blender'. I don't really know what the point of the post csc gamma is though. Normally you would not want to reapply any gamma prior to blending.
The only use case I can think of would be if you don't have a gamma lut in the crtc for post blend gamma. In that case I suppose you might consider doing the gamma before blending and accepting the slightly incorrect blending results. But at least on our hardware we always have a gamma lut in the crtc as well.
So yeah, I don't really have any reason why we'd need to actually to expose the per-plane gamma. Some "crazy" artistic use case perhaps?
I'm totally fine not exposing it until someone comes up with an actual use for it.
Does rk3399 have a dedicated csc for yuv->rgb before degamma? Or are you supposed to use the same csc for that as you'd use for ctm? In that case I can understand why the hw would have a gamm lut on each side of the csc. But it would also means that you can't do yuv->rgb and ctm at the same time unless you're fine with doing it wrong.
Quoted 145 lines · Harry Wentland
Quoted 137 lines · Daniele Castagna
Quoted 5 lines
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Add plane gamma as blob property and size as a
range property.Plane degamma & CTM make sense to me but I'm not sure why gamma would be on a per-plane basis. That said, HW sometimes has these implemented in odd ways. Do we know of any HW that will currently or in the future need per-plane gamma or are we just trying to cover all potentialities?
Harry
Quoted 126 lines
(am from https://patchwork.kernel.org/patch/9971325/)
Change-Id: I606cd40c9748b136fc2bf4750bea1da285add62d
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_atomic.c | 8 ++++++++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ drivers/gpu/drm/drm_mode_config.c | 14 ++++++++++++++ include/drm/drm_mode_config.h | 11 +++++++++++ include/drm/drm_plane.h | 9 +++++++++ 5 files changed, 46 insertions(+)drivers/gpu/drm/drm_atomic.c +8
-0@@ -778,6 +778,12 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, &replaced); state->color_mgmt_changed |= replaced;return ret; + }else if (property == config->plane_gamma_lut_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->gamma_lut, + val,-1 , &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }@@ -841,6 +847,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane, state->degamma_lut->base.id : 0; }else if (property == config->plane_ctm_property) { *val = (state->ctm) ? state->ctm->base.id :0 ; + }else if (property == config->plane_gamma_lut_property) { + *val = (state->gamma_lut) ? state->gamma_lut->base.id :0 ; }else {return -EINVAL ; }drivers/gpu/drm/drm_atomic_helper.c +4
-0@@ -3495,6 +3495,9 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,drm_property_reference_blob (state->degamma_lut);if (state->ctm)drm_property_reference_blob (state->ctm); +if (state->gamma_lut) +drm_property_reference_blob (state->gamma_lut); + state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);@@ -3543,6 +3546,7 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)drm_property_unreference_blob (state->degamma_lut);drm_property_unreference_blob (state->ctm); +drm_property_unreference_blob (state->gamma_lut); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);drivers/gpu/drm/drm_mode_config.c +14
-0@@ -368,6 +368,20 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.plane_ctm_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_GAMMA_LUT" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_property = prop; + + prop =drm_property_create_range (dev, +DRM_MODE_PROP_IMMUTABLE , +"PLANE_GAMMA_LUT_SIZE" ,0 ,UINT_MAX ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_size_property = prop; +return 0 ; }include/drm/drm_mode_config.h +11
-0@@ -740,6 +740,17 @@ struct drm_mode_config {* degamma LUT. */ struct drm_property *plane_ctm_property; +/** +* @plane_gamma_lut_property: Optional Plane property to set the LUT +* used to convert the colors, after the CTM matrix, to the common +* gamma space chosen for blending. +*/ +struct drm_property *plane_gamma_lut_property; +/** +* @plane_gamma_lut_size_property: Optional Plane property for the size +* of the gamma LUT as supported by the driver (read-only). +*/ +struct drm_property *plane_gamma_lut_size_property;/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the include/drm/drm_plane.h +9
-0@@ -147,6 +147,15 @@ struct drm_plane_state {*/ struct drm_property_blob *ctm; +/** +* @gamma_lut: +* +* Lookup table for converting pixel data after the color conversion +* matrix @ctm. See drm_plane_enable_color_mgmt(). The blob (if not +* NULL) is an array of &struct drm_color_lut. +*/ +struct drm_property_blob *gamma_lut; +struct drm_atomic_state *state;Quoted 2 lines
include/drm/drm_plane.h struct drm_plane_state { · line 161
Quoted 2 lines
include/drm/drm_plane.h +0
-0bool color_mgmt_changed : 1;_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/10] drm: Add Plane Gamma properties
Quoted 6 lines · Ville Syrjälä
Quoted 5 lines · Daniele Castagna
rk3399 has the option of setting per-plane gamma.
The YUV2YUV registers are per-plane. Each plane YUV2YUV pipeline has at least 3 optional stages, two of those being degamma and gamma, and they can be configured per-plane.
I don't mind having a per-plane gamma, especially since rk3399 has it in HW. It just seemed a bit curious to me and I'd rather avoid properties that would never be used by any driver.
Quoted 9 lines
Quoted 3 lines
I'm not sure about Intel HW. I think they might have something similar planned, considering the original patch was from uma.shankar. CCing directly in case he knows more.
IIRC some of out upcoming stuff will have a pipeline like '
csc->degamma->csc->gamma->blender'. I don't really know what the point of the post csc gamma is though. Normally you would not want to reapply any gamma prior to blending.
Quoted 5 lines
The only use case I can think of would be if you don't have a gamma lut in the crtc for post blend gamma. In that case I suppose you might consider doing the gamma before blending and accepting the slightly incorrect blending results. But at least on our hardware we always have a gamma lut in the crtc as well.
That's what I was thinking of as the only possible use-case as well.
Harry
Quoted 4 lines
So yeah, I don't really have any reason why we'd need to actually to expose the per-plane gamma. Some "crazy" artistic use case perhaps?
Quoted 155 lines
I'm totally fine not exposing it until someone comes up with an actual use for it.
Does rk3399 have a dedicated csc for
yuv->rgbbefore degamma? Or are you supposed to use the same csc for that as you'd use for ctm? In that case I can understand why the hw would have a gamm lut on each side of the csc. But it would also means that you can't doyuv->rgband ctm at the same time unless you're fine with doing it wrong.Quoted 145 lines · Harry Wentland
Quoted 137 lines · Daniele Castagna
Quoted 5 lines
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Add plane gamma as blob property and size as a
range property.Plane degamma & CTM make sense to me but I'm not sure why gamma would be on a per-plane basis. That said, HW sometimes has these implemented in odd ways. Do we know of any HW that will currently or in the future need per-plane gamma or are we just trying to cover all potentialities?
Harry
Quoted 126 lines
(am from https://patchwork.kernel.org/patch/9971325/)
Change-Id: I606cd40c9748b136fc2bf4750bea1da285add62d
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_atomic.c | 8 ++++++++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ drivers/gpu/drm/drm_mode_config.c | 14 ++++++++++++++ include/drm/drm_mode_config.h | 11 +++++++++++ include/drm/drm_plane.h | 9 +++++++++ 5 files changed, 46 insertions(+)drivers/gpu/drm/drm_atomic.c +8
-0@@ -778,6 +778,12 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, &replaced); state->color_mgmt_changed |= replaced;return ret; + }else if (property == config->plane_gamma_lut_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->gamma_lut, + val,-1 , &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }@@ -841,6 +847,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane, state->degamma_lut->base.id : 0; }else if (property == config->plane_ctm_property) { *val = (state->ctm) ? state->ctm->base.id :0 ; + }else if (property == config->plane_gamma_lut_property) { + *val = (state->gamma_lut) ? state->gamma_lut->base.id :0 ; }else {return -EINVAL ; }drivers/gpu/drm/drm_atomic_helper.c +4
-0@@ -3495,6 +3495,9 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,drm_property_reference_blob (state->degamma_lut);if (state->ctm)drm_property_reference_blob (state->ctm); +if (state->gamma_lut) +drm_property_reference_blob (state->gamma_lut); + state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);@@ -3543,6 +3546,7 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)drm_property_unreference_blob (state->degamma_lut);drm_property_unreference_blob (state->ctm); +drm_property_unreference_blob (state->gamma_lut); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);drivers/gpu/drm/drm_mode_config.c +14
-0@@ -368,6 +368,20 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.plane_ctm_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_GAMMA_LUT" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_property = prop; + + prop =drm_property_create_range (dev, +DRM_MODE_PROP_IMMUTABLE , +"PLANE_GAMMA_LUT_SIZE" ,0 ,UINT_MAX ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_size_property = prop; +return 0 ; }include/drm/drm_mode_config.h +11
-0@@ -740,6 +740,17 @@ struct drm_mode_config {* degamma LUT. */ struct drm_property *plane_ctm_property; +/** +* @plane_gamma_lut_property: Optional Plane property to set the LUT +* used to convert the colors, after the CTM matrix, to the common +* gamma space chosen for blending. +*/ +struct drm_property *plane_gamma_lut_property; +/** +* @plane_gamma_lut_size_property: Optional Plane property for the size +* of the gamma LUT as supported by the driver (read-only). +*/ +struct drm_property *plane_gamma_lut_size_property;/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the include/drm/drm_plane.h +9
-0@@ -147,6 +147,15 @@ struct drm_plane_state {*/ struct drm_property_blob *ctm; +/** +* @gamma_lut: +* +* Lookup table for converting pixel data after the color conversion +* matrix @ctm. See drm_plane_enable_color_mgmt(). The blob (if not +* NULL) is an array of &struct drm_color_lut. +*/ +struct drm_property_blob *gamma_lut; +struct drm_atomic_state *state;Quoted 2 lines
include/drm/drm_plane.h struct drm_plane_state { · line 161
Quoted 2 lines
include/drm/drm_plane.h +0
-0bool color_mgmt_changed : 1;_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RE: [PATCH 04/10] drm: Add Plane Gamma properties
Quoted 31 lines
-----Original Message-----
From: Harry Wentland [mailto:[email protected]]
Sent: Saturday, February 17, 2018 3:07 AM
To: Ville Syrjälä <[email protected]>; Daniele Castagna <[email protected]>
Cc: Shankar, Uma <[email protected]>; [email protected]
Subject: Re: [PATCH 04/10] drm: Add Plane Gamma propertiesQuoted 6 lines · Ville Syrjälä
Quoted 5 lines · Daniele Castagna
rk3399 has the option of setting per-plane gamma.
The YUV2YUV registers are per-plane. Each plane YUV2YUV pipeline has at least 3 optional stages, two of those being degamma and gamma, and they can be configured per-plane.I don't mind having a per-plane gamma, especially since rk3399 has it in HW. It just seemed a bit curious to me and I'd rather avoid properties that would never be used by any driver.
Quoted 9 lines
Quoted 3 lines
I'm not sure about Intel HW. I think they might have something similar planned, considering the original patch was from uma.shankar. CCing directly in case he knows more.
IIRC some of out upcoming stuff will have a pipeline like '
csc->degamma->csc->gamma->blender'. I don't really know what the point of the post csc gamma is though. Normally you would not want to reapply any gamma prior to blending.
Quoted 8 lines
Quoted 5 lines
The only use case I can think of would be if you don't have a gamma lut in the crtc for post blend gamma. In that case I suppose you might consider doing the gamma before blending and accepting the slightly incorrect blending results. But at least on our hardware we always have a gamma lut in the crtc as well.
That's what I was thinking of as the only possible use-case as well.
The primary use case of the post CSC plane gamma LUT will be to do tone mapping in case of HDR data. Again the accuracy of it will depend on the number of LUT samples and precision. It could be used, if for some strange use case we want non-linear blending. I believe Android was using non-linear blending by design (not sure if it changed in recent variants). Also as Ville mentioned, if we lack gamma at pipe level on certain hardware, this may be required. But tone mapping is the primary use case.
Regards,
Uma Shankar
Quoted 136 lines
Harry
Quoted 15 lines
So yeah, I don't really have any reason why we'd need to actually to expose the per-plane gamma. Some "crazy" artistic use case perhaps?
I'm totally fine not exposing it until someone comes up with an actual use for it.
Does rk3399 have a dedicated csc for
yuv->rgbbefore degamma? Or are you supposed to use the same csc for that as you'd use for ctm? In that case I can understand why the hw would have a gamm lut on each side of the csc. But it would also means that you can't doyuv->rgband ctm at the same time unless you're fine with doing it wrong.Quoted 2 lines
On Thu, Feb 15, 2018 at 2:29 PM, Harry Wentland
Quoted 8 lines · <[email protected]> wrote:
Quoted 8 lines
Quoted 8 lines · Daniele Castagna
Quoted 5 lines
From: "uma.shankar at intel.com (Uma Shankar)"
<[email protected]>Add plane gamma as blob property and size as a range property.
Plane degamma & CTM make sense to me but I'm not sure why gamma
would be on a per-plane basis. That said, HW sometimes has these implemented in odd ways. Do we know of any HW that will currently or in the future need per- plane gamma or are we just trying to cover all potentialities?
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Harry
Quoted 12 lines
(am from https://patchwork.kernel.org/patch/9971325/)
Change-Id: I606cd40c9748b136fc2bf4750bea1da285add62d
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_atomic.c | 8 ++++++++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ drivers/gpu/drm/drm_mode_config.c | 14 ++++++++++++++ include/drm/drm_mode_config.h | 11 +++++++++++ include/drm/drm_plane.h | 9 +++++++++ 5 files changed, 46 insertions(+)Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/drm_atomic.c static int drm_atomic_plane_set_property(struct
Quoted 6 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/drm_atomic.cindexd4b8c6cc84128..f634f6450f415100644drivers/gpu/drm/drm_atomic.c +0
-0@@ -778,6 +778,12 @@ static int drm_atomic_plane_set_property(struct
drm_plane*plane,Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/drm_atomic.c +2
-0&replaced); state->color_mgmt_changed |= replaced;return ret; + }else if (property == config->plane_gamma_lut_property) { + ret = drm_atomic_replace_property_blob_from_id(dev,Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/drm_atomic.c drm_atomic_plane_get_property(struct drm_plane
Quoted 8 lines
drivers/gpu/drm/drm_atomic.c +4
-0+ &state->gamma_lut, + val, -1, &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }@@ -841,6 +847,8 @@ drm_atomic_plane_get_property(struct drm_plane*plane,
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/drm_atomic.c +3
-0state->degamma_lut->base.id : 0; }else if (property == config->plane_ctm_property) { *val = (state->ctm) ? state->ctm->base.id :0 ; + }else if (property == config->plane_gamma_lut_property) { + *val = (state->gamma_lut) ? state->gamma_lut->base.id + :0 ; }else {Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/drm_atomic_helper.c void
Quoted 8 lines
drivers/gpu/drm/drm_atomic.c +0
-0return -EINVAL ; }drivers/gpu/drm/drm_atomic_helper.c +0
-0@@ -3495,6 +3495,9 @@ void__drm_atomic_helper_plane_duplicate_state(struct
drm_plane*plane,Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
drivers/gpu/drm/drm_atomic_helper.c +3
-0drm_property_reference_blob (state->degamma_lut);if (state->ctm)drm_property_reference_blob (state->ctm); +if (state->gamma_lut) +drm_property_reference_blob (state->gamma_lut); + state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);@@ -3543,6 +3546,7 @@ void
__drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)drm_property_unreference_blob(state->degamma_lut); drm_property_unreference_blob(state->ctm);+
drm_property_unreference_blob(state->gamma_lut);
}EXPORT_SYMBOL(__drm_atomic_helper_plane_destroy_state);Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/drm_mode_config.c static int
Quoted 6 lines
drivers/gpu/drm/drm_mode_config.c +0
-0@@ -368,6 +368,20 @@ static int
drm_mode_create_standard_properties(struct drm_device *dev)Quoted 30 lines
Quoted 30 lines
Quoted 30 lines
Quoted 30 lines
drivers/gpu/drm/drm_mode_config.c +14
-0return -ENOMEM ; dev->mode_config.plane_ctm_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_GAMMA_LUT" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_property = prop; + + prop =drm_property_create_range (dev, +DRM_MODE_PROP_IMMUTABLE , +"PLANE_GAMMA_LUT_SIZE" ,0 ,UINT_MAX ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_size_property = prop; +return 0 ; }(quoted diff) +0
-0
b/include/drm/drm_mode_config.hindexad7235ced531b..3ca3eb3c98950100644include/drm/drm_mode_config.h +1
-0@@ -740,6 +740,17 @@ struct drm_mode_config {* degamma LUT. */ struct drm_property *plane_ctm_property; +/**
Quoted 40 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
include/drm/drm_mode_config.h struct drm_mode_config {
Quoted 7 lines
include/drm/drm_mode_config.h +7
-0+* @plane_gamma_lut_property: Optional Plane property to set the LUT +* used to convert the colors, after the CTM matrix, to the common +* gamma space chosen for blending. +*/ +struct drm_property *plane_gamma_lut_property; +/** +* @plane_gamma_lut_size_property: Optional Plane property for the size
Quoted 32 lines
Quoted 31 lines
Quoted 25 lines
Quoted 25 lines
include/drm/drm_mode_config.h +3
-1+* of the gamma LUT as supported by the driver (read-only). +*/ +struct drm_property *plane_gamma_lut_size_property;/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h index
21aecc9c91a09..acabb85009a14100644include/drm/drm_plane.h +9
-0@@ -147,6 +147,15 @@ struct drm_plane_state {*/ struct drm_property_blob *ctm; +/** +* @gamma_lut: +* +* Lookup table for converting pixel data after the color conversion +* matrix @ctm. See drm_plane_enable_color_mgmt(). The blob (if not +* NULL) is an array of &struct drm_color_lut. +*/ +struct drm_property_blob *gamma_lut; +struct drm_atomic_state *state;Quoted 2 lines
include/drm/drm_plane.h struct drm_plane_state { · line 161
Quoted 2 lines
include/drm/drm_plane.h +0
-0bool color_mgmt_changed : 1;_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/10] drm: Add Plane Gamma properties
In reply to Daniele CastagnaQuoted 9 lines · Daniele Castagna
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Add plane gamma as blob property and size as a
range property.(am from https://patchwork.kernel.org/patch/9971325/)
Change-Id: I606cd40c9748b136fc2bf4750bea1da285add62d
Signed-off-by: Uma Shankar <uma.shankar at intel.com>
Please also add kerneldoc for the properties itself, see
https://dri.freedesktop.org/docs/drm/gpu/drm-kms.html#color-management-properties
That means we need a bunch of rewording, now that we're adding planes.
I also think a small diagram that shows the full pipeline (which probably no hw ever implements) would be really good. See the various inlined dot files we have in the KMS documentation already.
Thanks, Daniel
Quoted 130 lines
--- drivers/gpu/drm/drm_atomic.c | 8 ++++++++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ drivers/gpu/drm/drm_mode_config.c | 14 ++++++++++++++ include/drm/drm_mode_config.h | 11 +++++++++++ include/drm/drm_plane.h | 9 +++++++++ 5 files changed, 46 insertions(+)drivers/gpu/drm/drm_atomic.c +8
-0@@ -778,6 +778,12 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, &replaced); state->color_mgmt_changed |= replaced;return ret; + }else if (property == config->plane_gamma_lut_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->gamma_lut, + val,-1 , &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }@@ -841,6 +847,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane, state->degamma_lut->base.id : 0; }else if (property == config->plane_ctm_property) { *val = (state->ctm) ? state->ctm->base.id :0 ; + }else if (property == config->plane_gamma_lut_property) { + *val = (state->gamma_lut) ? state->gamma_lut->base.id :0 ; }else {return -EINVAL ; }drivers/gpu/drm/drm_atomic_helper.c +4
-0@@ -3495,6 +3495,9 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,drm_property_reference_blob (state->degamma_lut);if (state->ctm)drm_property_reference_blob (state->ctm); +if (state->gamma_lut) +drm_property_reference_blob (state->gamma_lut); + state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);@@ -3543,6 +3546,7 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)drm_property_unreference_blob (state->degamma_lut);drm_property_unreference_blob (state->ctm); +drm_property_unreference_blob (state->gamma_lut); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);drivers/gpu/drm/drm_mode_config.c +14
-0@@ -368,6 +368,20 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.plane_ctm_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_GAMMA_LUT" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_property = prop; + + prop =drm_property_create_range (dev, +DRM_MODE_PROP_IMMUTABLE , +"PLANE_GAMMA_LUT_SIZE" ,0 ,UINT_MAX ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_size_property = prop; +return 0 ; }include/drm/drm_mode_config.h +11
-0@@ -740,6 +740,17 @@ struct drm_mode_config {* degamma LUT. */ struct drm_property *plane_ctm_property; +/** +* @plane_gamma_lut_property: Optional Plane property to set the LUT +* used to convert the colors, after the CTM matrix, to the common +* gamma space chosen for blending. +*/ +struct drm_property *plane_gamma_lut_property; +/** +* @plane_gamma_lut_size_property: Optional Plane property for the size +* of the gamma LUT as supported by the driver (read-only). +*/ +struct drm_property *plane_gamma_lut_size_property;/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the include/drm/drm_plane.h +9
-0@@ -147,6 +147,15 @@ struct drm_plane_state {*/ struct drm_property_blob *ctm; +/** +* @gamma_lut: +* +* Lookup table for converting pixel data after the color conversion +* matrix @ctm. See drm_plane_enable_color_mgmt(). The blob (if not +* NULL) is an array of &struct drm_color_lut. +*/ +struct drm_property_blob *gamma_lut; +struct drm_atomic_state *state; bool color_mgmt_changed : 1;Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/10] drm: Add Plane Gamma properties
In reply to Daniele CastagnaQuoted 99 lines · Daniele Castagna
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Add plane gamma as blob property and size as a
range property.(am from https://patchwork.kernel.org/patch/9971325/)
Change-Id: I606cd40c9748b136fc2bf4750bea1da285add62d
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_atomic.c | 8 ++++++++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ drivers/gpu/drm/drm_mode_config.c | 14 ++++++++++++++ include/drm/drm_mode_config.h | 11 +++++++++++ include/drm/drm_plane.h | 9 +++++++++ 5 files changed, 46 insertions(+)drivers/gpu/drm/drm_atomic.c +8
-0@@ -778,6 +778,12 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, &replaced); state->color_mgmt_changed |= replaced;return ret; + }else if (property == config->plane_gamma_lut_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->gamma_lut, + val,-1 , &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }@@ -841,6 +847,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane, state->degamma_lut->base.id : 0; }else if (property == config->plane_ctm_property) { *val = (state->ctm) ? state->ctm->base.id :0 ; + }else if (property == config->plane_gamma_lut_property) { + *val = (state->gamma_lut) ? state->gamma_lut->base.id :0 ; }else {return -EINVAL ; }drivers/gpu/drm/drm_atomic_helper.c +4
-0@@ -3495,6 +3495,9 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,drm_property_reference_blob (state->degamma_lut);if (state->ctm)drm_property_reference_blob (state->ctm); +if (state->gamma_lut) +drm_property_reference_blob (state->gamma_lut); + state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);@@ -3543,6 +3546,7 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)drm_property_unreference_blob (state->degamma_lut);drm_property_unreference_blob (state->ctm); +drm_property_unreference_blob (state->gamma_lut); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);drivers/gpu/drm/drm_mode_config.c +14
-0@@ -368,6 +368,20 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.plane_ctm_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_GAMMA_LUT" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_property = prop; + + prop =drm_property_create_range (dev, +DRM_MODE_PROP_IMMUTABLE , +"PLANE_GAMMA_LUT_SIZE" ,0 ,UINT_MAX ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_size_property = prop; +return 0 ; }include/drm/drm_mode_config.h +1
-0@@ -740,6 +740,17 @@ struct drm_mode_config {* degamma LUT. */ struct drm_property *plane_ctm_property; +/**
include/drm/drm_mode_config.h struct drm_mode_config { · line 753
Quoted 10 lines
include/drm/drm_mode_config.h +10
-0+* @plane_gamma_lut_property: Optional Plane property to set the LUT +* used to convert the colors, after the CTM matrix, to the common +* gamma space chosen for blending. +*/ +struct drm_property *plane_gamma_lut_property; +/** +* @plane_gamma_lut_size_property: Optional Plane property for the size +* of the gamma LUT as supported by the driver (read-only). +*/ +struct drm_property *plane_gamma_lut_size_property;
Same comments here about drm_property location.
Quoted 9 lines
include/drm/drm_mode_config.h +0
-0/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the include/drm/drm_plane.h +0
-0@@ -147,6 +147,15 @@ struct drm_plane_state {*/
include/drm/drm_plane.h struct drm_plane_state { · line 157
Quoted 10 lines
include/drm/drm_plane.h +8
-0struct drm_property_blob *ctm; +/** +* @gamma_lut: +* +* Lookup table for converting pixel data after the color conversion +* matrix @ctm. See drm_plane_enable_color_mgmt(). The blob (if not +* NULL) is an array of &struct drm_color_lut. +*/ +struct drm_property_blob *gamma_lut;
Will 16-bit be sufficient here as well, or will we want to use the 32-bit variant that is required for degamma?
Sean
Quoted 11 lines
include/drm/drm_plane.h +1
-0+struct drm_atomic_state *state; bool color_mgmt_changed : 1;Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/10] drm: Add Plane Gamma properties
Quoted 124 lines · Sean Paul
Quoted 99 lines · Daniele Castagna
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Add plane gamma as blob property and size as a
range property.(am from https://patchwork.kernel.org/patch/9971325/)
Change-Id: I606cd40c9748b136fc2bf4750bea1da285add62d
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_atomic.c | 8 ++++++++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ drivers/gpu/drm/drm_mode_config.c | 14 ++++++++++++++ include/drm/drm_mode_config.h | 11 +++++++++++ include/drm/drm_plane.h | 9 +++++++++ 5 files changed, 46 insertions(+)drivers/gpu/drm/drm_atomic.c +8
-0@@ -778,6 +778,12 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, &replaced); state->color_mgmt_changed |= replaced;return ret; + }else if (property == config->plane_gamma_lut_property) { + ret =drm_atomic_replace_property_blob_from_id (dev, + &state->gamma_lut, + val,-1 , &replaced); + state->color_mgmt_changed |= replaced; +return ret; }else {return -EINVAL ; }@@ -841,6 +847,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane, state->degamma_lut->base.id : 0; }else if (property == config->plane_ctm_property) { *val = (state->ctm) ? state->ctm->base.id :0 ; + }else if (property == config->plane_gamma_lut_property) { + *val = (state->gamma_lut) ? state->gamma_lut->base.id :0 ; }else {return -EINVAL ; }drivers/gpu/drm/drm_atomic_helper.c +4
-0@@ -3495,6 +3495,9 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,drm_property_reference_blob (state->degamma_lut);if (state->ctm)drm_property_reference_blob (state->ctm); +if (state->gamma_lut) +drm_property_reference_blob (state->gamma_lut); + state->color_mgmt_changed = false; }EXPORT_SYMBOL (__drm_atomic_helper_plane_duplicate_state);@@ -3543,6 +3546,7 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)drm_property_unreference_blob (state->degamma_lut);drm_property_unreference_blob (state->ctm); +drm_property_unreference_blob (state->gamma_lut); }EXPORT_SYMBOL (__drm_atomic_helper_plane_destroy_state);drivers/gpu/drm/drm_mode_config.c +14
-0@@ -368,6 +368,20 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.plane_ctm_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_BLOB , +"PLANE_GAMMA_LUT" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_property = prop; + + prop =drm_property_create_range (dev, +DRM_MODE_PROP_IMMUTABLE , +"PLANE_GAMMA_LUT_SIZE" ,0 ,UINT_MAX ); +if (!prop) +return -ENOMEM ; + dev->mode_config.plane_gamma_lut_size_property = prop; +return 0 ; }include/drm/drm_mode_config.h +1
-0@@ -740,6 +740,17 @@ struct drm_mode_config {* degamma LUT. */ struct drm_property *plane_ctm_property; +/** include/drm/drm_mode_config.h struct drm_mode_config { · line 753
Quoted 10 lines
include/drm/drm_mode_config.h +10
-0+* @plane_gamma_lut_property: Optional Plane property to set the LUT +* used to convert the colors, after the CTM matrix, to the common +* gamma space chosen for blending. +*/ +struct drm_property *plane_gamma_lut_property; +/** +* @plane_gamma_lut_size_property: Optional Plane property for the size +* of the gamma LUT as supported by the driver (read-only). +*/ +struct drm_property *plane_gamma_lut_size_property;Same comments here about
drm_propertylocation.Quoted 11 lines
include/drm/drm_mode_config.h +0
-0/** * @ctm_property: Optional CRTC property to set the * matrix used to convert colors after the lookup in the include/drm/drm_plane.h +0
-0@@ -147,6 +147,15 @@ struct drm_plane_state {*/ struct drm_property_blob *ctm;
Quoted 11 lines
include/drm/drm_plane.h struct drm_plane_state { · line 157
Quoted 8 lines
include/drm/drm_plane.h +8
-0+/** +* @gamma_lut: +* +* Lookup table for converting pixel data after the color conversion +* matrix @ctm. See drm_plane_enable_color_mgmt(). The blob (if not +* NULL) is an array of &struct drm_color_lut. +*/ +struct drm_property_blob *gamma_lut;Will 16-bit be sufficient here as well, or will we want to use the 32-bit variant that is required for degamma?
Someone proposing expanding the luts beying u0.16? I have been recently thinking about making the luts support values outside the [0.0,1.0) interval by stealing bits from the 'u16 reserved' have in drm_color_lut. At least modern intel hw can do up to [0.0,8.0) (and it also mirrors the values across the origin for negative inputs). Now, I don't have an immediate use for that but I think some xvYCC type of stuff with out of gamut values is one potential use case. There are potentially 5 bits per component to use, so s5.16 might be the thing I'd consider. That would cover the capabilities of intel hw. But if people are thinking that the .16 is not enough then I supposer we might have to consider a totally new property with higher precision lut entries, in which case extending the current thing doesn't make much sense.
Another thing I've been sketching out in my head is some kind of enum property that actually describes the diffrent modes the luts/ctm support. This would allow the client to eg. select between modes with a proper LUT with lower precision vs. an interpolated curve with higher precision. At least on intel hw the crtc luts support several different modes. My current plan is that each mode would consist of a set of intervals, where each interval a small structure which describes how the hardware operates on input values in that range. Each set of intervals would be exposed as a blob, and the blobs would be exposed via an enum property. Such a blob enum property wouldn't allow the user to provide and arbitrary blob and instead the blob id must match one of the enum values.
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 5/10 drm: Define helper function for plane color enabling
In reply to Daniele CastagnaFrom: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Define helper function to enable Plane color features to attach plane color properties to plane structure.
(am from https://patchwork.kernel.org/patch/9971333/)
Change-Id: I0a6647607fe482786e7cdb5f997faf196b2f59a2
Signed-off-by: Uma Shankar <uma.shankar at intel.com>
--- drivers/gpu/drm/drm_plane.c | 48 ++++++++++++++++++++++++++++++++++++ include/drm/drm_color_mgmt.h | 5 ++++ 2 files changed, 53 insertions(+)
drivers/gpu/drm/drm_plane.c +48 -0
@@ -143,6 +143,54 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *planereturn 0 ; } +/** +* drm_plane_enable_color_mgmt - enable color management properties +* @plane: DRM Plane +* @plane_degamma_lut_size: the size of the degamma lut (before CSC) +* @plane_has_ctm: whether to attach ctm_property for CSC matrix +* @plane_gamma_lut_size: the size of the gamma lut (after CSC) +* +* This function lets the driver enable the color correction +* properties on a plane. This includes 3 degamma, csc and gamma +* properties that userspace can set and 2 size properties to inform +* the userspace of the lut sizes. Each of the properties are +* optional. The gamma and degamma properties are only attached if +* their size is not 0 and ctm_property is only attached if has_ctm is +* true. +* +* Drivers should use drm_atomic_helper_legacy_gamma_set() to implement the +* legacy &drm_crtc_funcs.gamma_set callback. +*/ +void drm_plane_enable_color_mgmt (struct drm_plane *plane, +uint plane_degamma_lut_size, +bool plane_has_ctm, +uint plane_gamma_lut_size) +{ +struct drm_device *dev = plane->dev; +struct drm_mode_config *config = &dev->mode_config; + +if (plane_degamma_lut_size) { +drm_object_attach_property (&plane->base, + config->plane_degamma_lut_property,0 ); +drm_object_attach_property (&plane->base, + config->plane_degamma_lut_size_property, + plane_degamma_lut_size); + } + +if (plane_has_ctm) +drm_object_attach_property (&plane->base, + config->plane_ctm_property,0 ); + +if (plane_gamma_lut_size) { +drm_object_attach_property (&plane->base, + config->plane_gamma_lut_property,0 ); +drm_object_attach_property (&plane->base, + config->plane_gamma_lut_size_property, + plane_gamma_lut_size); + } +} +EXPORT_SYMBOL (drm_plane_enable_color_mgmt); +/** * drm_universal_plane_init - Initialize a new universal plane object * @dev: DRM device
include/drm/drm_color_mgmt.h +5 -0
@@ -37,4 +37,9 @@ void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc,int drm_mode_crtc_set_gamma_size (struct drm_crtc *crtc,int gamma_size); +void drm_plane_enable_color_mgmt (struct drm_plane *plane, +uint plane_degamma_lut_size, +bool plane_has_ctm, +uint plane_gamma_lut_size); +#endif
Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 05/10] drm: Define helper function for plane color enabling
Quoted 35 lines · Daniele Castagna
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Define helper function to enable Plane color features to attach plane color properties to plane structure.
(am from https://patchwork.kernel.org/patch/9971333/)
Change-Id: I0a6647607fe482786e7cdb5f997faf196b2f59a2
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_plane.c | 48 ++++++++++++++++++++++++++++++++++++ include/drm/drm_color_mgmt.h | 5 ++++ 2 files changed, 53 insertions(+)drivers/gpu/drm/drm_plane.c +13
-0@@ -143,6 +143,54 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *planereturn 0 ; } +/** +* drm_plane_enable_color_mgmt - enable color management properties +* @plane: DRM Plane +* @plane_degamma_lut_size: the size of the degamma lut (before CSC) +* @plane_has_ctm: whether to attach ctm_property for CSC matrix +* @plane_gamma_lut_size: the size of the gamma lut (after CSC) +* +* This function lets the driver enable the color correction +* properties on a plane. This includes 3 degamma, csc and gamma +* properties that userspace can set and 2 size properties to inform +* the userspace of the lut sizes. Each of the properties are +* optional. The gamma and degamma properties are only attached if +* their size is not 0 and ctm_property is only attached if has_ctm is
drivers/gpu/drm/drm_plane.c static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane · line 168
Quoted 10 lines
drivers/gpu/drm/drm_plane.c +10
-0+* true. +* +* Drivers should use drm_atomic_helper_legacy_gamma_set() to implement the +* legacy &drm_crtc_funcs.gamma_set callback. +*/ +void drm_plane_enable_color_mgmt (struct drm_plane *plane, +uint plane_degamma_lut_size, +bool plane_has_ctm, +uint plane_gamma_lut_size) +{
This seems like a good place to create the properties once they're located in drm_plane.
Quoted 49 lines
drivers/gpu/drm/drm_plane.c +25
-0+struct drm_device *dev = plane->dev; +struct drm_mode_config *config = &dev->mode_config; + +if (plane_degamma_lut_size) { +drm_object_attach_property (&plane->base, + config->plane_degamma_lut_property,0 ); +drm_object_attach_property (&plane->base, + config->plane_degamma_lut_size_property, + plane_degamma_lut_size); + } + +if (plane_has_ctm) +drm_object_attach_property (&plane->base, + config->plane_ctm_property,0 ); + +if (plane_gamma_lut_size) { +drm_object_attach_property (&plane->base, + config->plane_gamma_lut_property,0 ); +drm_object_attach_property (&plane->base, + config->plane_gamma_lut_size_property, + plane_gamma_lut_size); + } +} +EXPORT_SYMBOL (drm_plane_enable_color_mgmt); +/** * drm_universal_plane_init - Initialize a new universal plane object * @dev: DRM device include/drm/drm_color_mgmt.h +5
-0@@ -37,4 +37,9 @@ void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc,int drm_mode_crtc_set_gamma_size (struct drm_crtc *crtc,int gamma_size); +void drm_plane_enable_color_mgmt (struct drm_plane *plane, +uint plane_degamma_lut_size, +bool plane_has_ctm, +uint plane_gamma_lut_size); +#endif Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RE: [PATCH 05/10] drm: Define helper function for plane color enabling
Quoted 55 lines
-----Original Message-----
From: dri-devel [mailto:[email protected]] On Behalf Of Sean Paul
Sent: Tuesday, February 27, 2018 8:59 PM
To: Daniele Castagna <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 05/10] drm: Define helper function for plane color enablingdrivers/gpu/drm/drm_plane.c static int create_in_format_blob(struct drm_device
Quoted 20 lines · Daniele Castagna
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Define helper function to enable Plane color features to attach plane color properties to plane structure.
(am from https://patchwork.kernel.org/patch/9971333/)
Change-Id: I0a6647607fe482786e7cdb5f997faf196b2f59a2
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_plane.c | 48 ++++++++++++++++++++++++++++++++++++ include/drm/drm_color_mgmt.h | 5 ++++ 2 files changed, 53 insertions(+)drivers/gpu/drm/drm_plane.c +0
-0@@ -143,6 +143,54 @@ static int create_in_format_blob(struct drm_device*dev, struct
drm_plane*planeQuoted 23 lines
drivers/gpu/drm/drm_plane.c +20
-0return 0 ; } +/** +* drm_plane_enable_color_mgmt - enable color management properties +* @plane: DRM Plane +* @plane_degamma_lut_size: the size of the degamma lut (before CSC) +* @plane_has_ctm: whether to attach ctm_property for CSC matrix +* @plane_gamma_lut_size: the size of the gamma lut (after CSC) +* +* This function lets the driver enable the color correction +* properties on a plane. This includes 3 degamma, csc and gamma +* properties that userspace can set and 2 size properties to inform +* the userspace of the lut sizes. Each of the properties are +* optional. The gamma and degamma properties are only attached if +* their size is not 0 and ctm_property is only attached if has_ctm +is +* true. +* +* Drivers should use drm_atomic_helper_legacy_gamma_set() to +implement the +* legacy &drm_crtc_funcs.gamma_set callback. +*/
Quoted 9 lines
drivers/gpu/drm/drm_plane.c static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane · line 168
Quoted 5 lines
drivers/gpu/drm/drm_plane.c +5
-0+void drm_plane_enable_color_mgmt (struct drm_plane *plane, +uint plane_degamma_lut_size, +bool plane_has_ctm, +uint plane_gamma_lut_size) +{This seems like a good place to create the properties once they're located in
drm_plane.
Yeah, I agree. Will update the series.
Regards,
Uma Shankar
Quoted 46 lines
Quoted 46 lines
drivers/gpu/drm/drm_plane.c +25
-0+struct drm_device *dev = plane->dev; +struct drm_mode_config *config = &dev->mode_config; + +if (plane_degamma_lut_size) { +drm_object_attach_property (&plane->base, + config->plane_degamma_lut_property,0 ); +drm_object_attach_property (&plane->base, + config->plane_degamma_lut_size_property, + plane_degamma_lut_size); + } + +if (plane_has_ctm) +drm_object_attach_property (&plane->base, + config->plane_ctm_property,0 ); + +if (plane_gamma_lut_size) { +drm_object_attach_property (&plane->base, + config->plane_gamma_lut_property,0 ); +drm_object_attach_property (&plane->base, + config->plane_gamma_lut_size_property, + plane_gamma_lut_size); + } +} +EXPORT_SYMBOL (drm_plane_enable_color_mgmt); +/** * drm_universal_plane_init - Initialize a new universal plane object * @dev: DRM device (quoted diff) +0
-0
b/include/drm/drm_color_mgmt.hindex03a59cbce6212..155a9ba38471c100644include/drm/drm_color_mgmt.h +5
-1@@ -37,4 +37,9 @@ void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc, int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, int gamma_size); +void drm_plane_enable_color_mgmt (struct drm_plane *plane, +uint plane_degamma_lut_size, +bool plane_has_ctm, +uint plane_gamma_lut_size); +#endif --2.16.1.291.g4437f3f132-goog
Quoted 11 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 6/10 drm: Define helper to set legacy gamma table size
In reply to Daniele CastagnaFrom: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Define a helper function to set legacy gamma table size for planes.
(am from https://patchwork.kernel.org/patch/9971343/)
Change-Id: I3d0c3e71d92300259cdfcebed4349207f64e4083
Signed-off-by: Uma Shankar <uma.shankar at intel.com>
--- drivers/gpu/drm/drm_color_mgmt.c | 41 ++++++++++++++++++++++++++++++++ include/drm/drm_color_mgmt.h | 3 +++ include/drm/drm_plane.h | 4 ++++ 3 files changed, 48 insertions(+)
drivers/gpu/drm/drm_color_mgmt.c +41 -0
@@ -203,6 +203,47 @@ int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, }EXPORT_SYMBOL (drm_mode_crtc_set_gamma_size); +/** +* drm_mode_plane_set_gamma_size - set the gamma table size +* @plane: Plane to set the gamma table size for +* @gamma_size: size of the gamma table +* +* Drivers which support gamma tables should set this to the supported gamma +* table size when initializing the Plane. Currently the drm core only supports +* a fixed gamma table size. +* +* Returns: +* Zero on success, negative errno on failure. +*/ +int drm_mode_plane_set_gamma_size (struct drm_plane *plane, +int gamma_size) +{ +uint16_t *r_base, *g_base, *b_base; +int i; + + plane->gamma_size = gamma_size; + + plane->gamma_store =kcalloc (gamma_size,sizeof (uint16_t ) *3 , +GFP_KERNEL ); +if (!plane->gamma_store) { + plane->gamma_size =0 ; +return -ENOMEM ; + } + + r_base = plane->gamma_store; + g_base = r_base + gamma_size; + b_base = g_base + gamma_size; +for (i =0 ; i < gamma_size; i++) { + r_base[i] = i <<8 ; + g_base[i] = i <<8 ; + b_base[i] = i <<8 ; + } + + +return 0 ; +} +EXPORT_SYMBOL (drm_mode_plane_set_gamma_size); +/** * drm_mode_gamma_set_ioctl - set the gamma table * @dev: DRM device
include/drm/drm_color_mgmt.h +3 -0
@@ -42,4 +42,7 @@ void drm_plane_enable_color_mgmt(struct drm_plane *plane,bool plane_has_ctm, uint plane_gamma_lut_size); +int drm_mode_plane_set_gamma_size (struct drm_plane *plane, +int plane_gamma_size); +#endif
include/drm/drm_plane.h +4 -0
@@ -585,6 +585,10 @@ struct drm_plane {struct drm_property *zpos_property;struct drm_property *rotation_property; + +/* Legacy FB Plane gamma size for reporting to userspace */ +uint32_t gamma_size; +uint16_t *gamma_store; };#define obj_to_plane (x) container_of(x, struct drm_plane, base)
Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
kbuild test robot
build botRe: [PATCH 06/10] drm: Define helper to set legacy gamma table size
Thank you for the patch! Perhaps something to improve:
Hi uma.shankar,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on rockchip/for-next]
[also build test WARNING on v4.16-rc1 next-20180216]
[cannot apply to drm/drm-next]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Daniele-Castagna/drm-rockchip-YUV-overlays-BT-601-color-conversion/20180216-233006 base: https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next reproduce: make htmldocs
All warnings (new ones prefixed by >>):
include/linux/crypto.h:477: warning: Function parameter or member 'cra_u.compress' not described in 'crypto_alg' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.ibss' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.connect' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.keys' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.ie' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.ie_len' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.bssid' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.prev_bssid' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.ssid' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.default_key' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.default_mgmt_key' not described in 'wireless_dev' include/net/cfg80211.h:4129: warning: Function parameter or member 'wext.prev_bssid_valid' not described in 'wireless_dev' include/net/mac80211.h:2259: warning: Function parameter or member 'radiotap_timestamp.units_pos' not described in 'ieee80211_hw' include/net/mac80211.h:2259: warning: Function parameter or member 'radiotap_timestamp.accuracy' not described in 'ieee80211_hw' include/net/mac80211.h:950: warning: Function parameter or member 'rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.rts_cts_rate_idx' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.use_rts' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.use_cts_prot' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.short_preamble' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.skip_table' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.jiffies' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.vif' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.hw_key' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.flags' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'control.enqueue_time' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'ack' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'ack.cookie' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'status.rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'status.ack_signal' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'status.ampdu_ack_len' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'status.ampdu_len' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'status.antenna' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'status.tx_time' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'status_driver_data' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'driver_rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'pad' not described in 'ieee80211_tx_info' include/net/mac80211.h:950: warning: Function parameter or member 'rate_driver_data' not described in 'ieee80211_tx_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'rx_stats_avg' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'rx_stats_avg.signal' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'rx_stats_avg.chain_signal' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'status_stats.filtered' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'status_stats.retry_failed' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'status_stats.retry_count' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'status_stats.lost_packets' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'status_stats.last_tdls_pkt_time' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'msdu_retries' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'msdu_failed' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'status_stats.last_ack' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'tx_stats.packets' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'tx_stats.bytes' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'tx_stats.last_rate' not described in 'sta_info' net/mac80211/sta_info.h:584: warning: Function parameter or member 'msdu' not described in 'sta_info' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_excl.cb' not described in 'dma_buf' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_excl.poll' not described in 'dma_buf' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_excl.active' not described in 'dma_buf' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_shared.cb' not described in 'dma_buf' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_shared.poll' not described in 'dma_buf' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_shared.active' not described in 'dma_buf' include/linux/dma-fence-array.h:54: warning: Function parameter or member 'work' not described in 'dma_fence_array' include/linux/gpio/driver.h:142: warning: Function parameter or member 'request_key' not described in 'gpio_irq_chip' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.sign' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.realbits' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.storagebits' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.shift' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.repeat' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.endianness' not described in 'iio_chan_spec' include/linux/iio/hw-consumer.h:1: warning: no structured comments found
include/linux/device.h:294: warning: Function parameter or member 'coredump' not described in 'device_driver' include/linux/input/sparse-keymap.h:46: warning: Function parameter or member 'sw' not described in 'key_entry' include/linux/mtd/rawnand.h:709: warning: Function parameter or member 'timings.sdr' not described in 'nand_data_interface' include/linux/mtd/rawnand.h:774: warning: Function parameter or member 'buf' not described in 'nand_op_data_instr' include/linux/mtd/rawnand.h:774: warning: Function parameter or member 'buf.in' not described in 'nand_op_data_instr' include/linux/mtd/rawnand.h:774: warning: Function parameter or member 'buf.out' not described in 'nand_op_data_instr' include/linux/mtd/rawnand.h:820: warning: Function parameter or member 'ctx' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:820: warning: Function parameter or member 'ctx.cmd' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:820: warning: Function parameter or member 'ctx.addr' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:820: warning: Function parameter or member 'ctx.data' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:820: warning: Function parameter or member 'ctx.waitrdy' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:967: warning: Function parameter or member 'ctx' not described in 'nand_op_parser_pattern_elem' include/linux/mtd/rawnand.h:967: warning: Function parameter or member 'ctx.addr' not described in 'nand_op_parser_pattern_elem' include/linux/mtd/rawnand.h:967: warning: Function parameter or member 'ctx.data' not described in 'nand_op_parser_pattern_elem' include/linux/mtd/rawnand.h:1281: warning: Function parameter or member 'manufacturer.desc' not described in 'nand_chip' include/linux/mtd/rawnand.h:1281: warning: Function parameter or member 'manufacturer.priv' not described in 'nand_chip' include/linux/regulator/driver.h:221: warning: Function parameter or member 'resume_early' not described in 'regulator_ops' drivers/regulator/core.c:4299: warning: Excess function parameter 'state' description in 'regulator_suspend_late' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw0' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw1' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw2' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw3' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.eadm' not described in 'irb' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_pin' not described in 'drm_driver' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_unpin' not described in 'drm_driver' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_res_obj' not described in 'drm_driver' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_get_sg_table' not described in 'drm_driver' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_import_sg_table' not described in 'drm_driver' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_vmap' not described in 'drm_driver' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_vunmap' not described in 'drm_driver' include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_mmap' not described in 'drm_driver' include/drm/drm_plane.h:163: warning: Function parameter or member 'degamma_lut' not described in 'drm_plane_state' include/drm/drm_plane.h:163: warning: Function parameter or member 'color_mgmt_changed' not described in 'drm_plane_state'
>> include/drm/drm_plane.h:593: warning: Function parameter or member 'gamma_size' not described in 'drm_plane' >> include/drm/drm_plane.h:593: warning: Function parameter or member 'gamma_store' not described in 'drm_plane'
include/drm/drm_connector.h:370: warning: Function parameter or member 'margins.left' not described in 'drm_tv_connector_state' include/drm/drm_connector.h:370: warning: Function parameter or member 'margins.right' not described in 'drm_tv_connector_state' include/drm/drm_connector.h:370: warning: Function parameter or member 'margins.top' not described in 'drm_tv_connector_state' include/drm/drm_connector.h:370: warning: Function parameter or member 'margins.bottom' not described in 'drm_tv_connector_state' include/drm/drm_vblank.h:63: warning: Function parameter or member 'event.base' not described in 'drm_pending_vblank_event' include/drm/drm_vblank.h:63: warning: Function parameter or member 'event.vbl' not described in 'drm_pending_vblank_event' include/drm/drm_vblank.h:63: warning: Function parameter or member 'event.seq' not described in 'drm_pending_vblank_event' drivers/gpu/drm/tve200/tve200_drv.c:1: warning: no structured comments found
include/linux/skbuff.h:846: warning: Function parameter or member 'dev_scratch' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'skb_mstamp' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member '__cloned_offset' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'head_frag' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member '__unused' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member '__pkt_type_offset' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'pfmemalloc' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'encapsulation' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'encap_hdr_csum' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'csum_valid' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'csum_complete_sw' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'csum_level' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'inner_protocol_type' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'remcsum_offload' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'offload_fwd_mark' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'offload_mr_fwd_mark' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'sender_cpu' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff' include/linux/skbuff.h:846: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff' include/net/sock.h:234: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_portpair' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_cookie' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_listener' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common' include/net/sock.h:487: warning: Function parameter or member 'sk_backlog.rmem_alloc' not described in 'sock' include/net/sock.h:487: warning: Function parameter or member 'sk_backlog.len' not described in 'sock'
include/net/sock.h:487: warning: Function parameter or member 'sk_backlog.head' not described in 'sock'
include/net/sock.h:487: warning: Function parameter or member 'sk_backlog.tail' not described in 'sock'
include/net/sock.h:487: warning: Function parameter or member 'sk_wq_raw' not described in 'sock'
include/net/sock.h:487: warning: Function parameter or member 'tcp_rtx_queue' not described in 'sock' include/linux/netdevice.h:1940: warning: Function parameter or member 'adj_list.upper' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'adj_list.lower' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'gso_partial_features' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'switchdev_ops' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'l3mdev_ops' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'xfrmdev_ops' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'name_assign_type' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'ieee802154_ptr' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'mpls_ptr' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'xdp_prog' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'gro_flush_timeout' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'nf_hooks_ingress' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member '____cacheline_aligned_in_smp' not described in 'net_device' include/linux/netdevice.h:1940: warning: Function parameter or member 'qdisc_hash' not described in 'net_device' include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising' not described in 'phylink_link_state' include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising' not described in 'phylink_link_state' include/linux/rcupdate.h:570: ERROR: Unexpected indentation.
include/linux/rcupdate.h:574: ERROR: Unexpected indentation.
include/linux/rcupdate.h:578: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/rcupdate.h:580: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/rcupdate.h:580: WARNING: Inline literal start-string without end-string.
kernel/time/timer.c:1259: ERROR: Unexpected indentation.
kernel/time/timer.c:1261: ERROR: Unexpected indentation.
kernel/time/timer.c:1262: WARNING: Block quote ends without a blank line; unexpected unindent.
include/linux/wait.h:110: WARNING: Block quote ends without a blank line; unexpected unindent.
include/linux/wait.h:113: ERROR: Unexpected indentation.
include/linux/wait.h:115: WARNING: Block quote ends without a blank line; unexpected unindent.
kernel/time/hrtimer.c:1113: WARNING: Block quote ends without a blank line; unexpected unindent.
kernel/signal.c:327: WARNING: Inline literal start-string without end-string.
drivers/video/fbdev/core/modedb.c:647: WARNING: Inline strong start-string without end-string. drivers/video/fbdev/core/modedb.c:647: WARNING: Inline strong start-string without end-string. drivers/video/fbdev/core/modedb.c:647: WARNING: Inline strong start-string without end-string. drivers/video/fbdev/core/modedb.c:647: WARNING: Inline strong start-string without end-string.
include/linux/iio/iio.h:191: ERROR: Unexpected indentation.
include/linux/iio/iio.h:192: WARNING: Block quote ends without a blank line; unexpected unindent.
include/linux/iio/iio.h:198: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/ata/libata-core.c:5920: ERROR: Unknown target name: "hw".
drivers/message/fusion/mptbase.c:5052: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/tty/serial/serial_core.c:1901: WARNING: Definition list ends without a blank line; unexpected unindent. include/linux/mtd/rawnand.h:805: ERROR: Unexpected indentation.
include/linux/mtd/rawnand.h:1391: WARNING: Inline strong start-string without end-string.
include/linux/mtd/rawnand.h:1393: WARNING: Inline strong start-string without end-string.
include/linux/regulator/driver.h:273: ERROR: Unknown target name: "regulator_regmap_x_voltage". Documentation/driver-api/slimbus.rst:93: WARNING: Title underline too short.
vim +593 include/drm/drm_plane.h
43968d7b Daniel Vetter 2016-09-21 @593
:::::: The code at line 593 was first introduced by commit :::::: 43968d7b806d7a7e021261294c583a216fddf0e5 drm: Extract drm_plane.[hc]
:::::: TO: Daniel Vetter <[email protected]> :::::: CC: Sean Paul <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 06/10] drm: Define helper to set legacy gamma table size
In reply to Daniele CastagnaQuoted 6 lines · Daniele Castagna
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Define a helper function to set legacy gamma table size for planes.
I don't see this used in the rest of the series. When it was originally introduced, it was accompanied by drm/i915: Enable plane color features, which seems to have been dropped.
Sean
Quoted 95 lines
Change-Id: I3d0c3e71d92300259cdfcebed4349207f64e4083
Signed-off-by: Uma Shankar <uma.shankar at intel.com>--- drivers/gpu/drm/drm_color_mgmt.c | 41 ++++++++++++++++++++++++++++++++ include/drm/drm_color_mgmt.h | 3 +++ include/drm/drm_plane.h | 4 ++++ 3 files changed, 48 insertions(+)drivers/gpu/drm/drm_color_mgmt.c +41
-0@@ -203,6 +203,47 @@ int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, }EXPORT_SYMBOL (drm_mode_crtc_set_gamma_size); +/** +* drm_mode_plane_set_gamma_size - set the gamma table size +* @plane: Plane to set the gamma table size for +* @gamma_size: size of the gamma table +* +* Drivers which support gamma tables should set this to the supported gamma +* table size when initializing the Plane. Currently the drm core only supports +* a fixed gamma table size. +* +* Returns: +* Zero on success, negative errno on failure. +*/ +int drm_mode_plane_set_gamma_size (struct drm_plane *plane, +int gamma_size) +{ +uint16_t *r_base, *g_base, *b_base; +int i; + + plane->gamma_size = gamma_size; + + plane->gamma_store =kcalloc (gamma_size,sizeof (uint16_t ) *3 , +GFP_KERNEL ); +if (!plane->gamma_store) { + plane->gamma_size =0 ; +return -ENOMEM ; + } + + r_base = plane->gamma_store; + g_base = r_base + gamma_size; + b_base = g_base + gamma_size; +for (i =0 ; i < gamma_size; i++) { + r_base[i] = i <<8 ; + g_base[i] = i <<8 ; + b_base[i] = i <<8 ; + } + + +return 0 ; +} +EXPORT_SYMBOL (drm_mode_plane_set_gamma_size); +/** * drm_mode_gamma_set_ioctl - set the gamma table * @dev: DRM device include/drm/drm_color_mgmt.h +3
-0@@ -42,4 +42,7 @@ void drm_plane_enable_color_mgmt(struct drm_plane *plane,bool plane_has_ctm, uint plane_gamma_lut_size); +int drm_mode_plane_set_gamma_size (struct drm_plane *plane, +int plane_gamma_size); +#endif include/drm/drm_plane.h +4
-0@@ -585,6 +585,10 @@ struct drm_plane {struct drm_property *zpos_property;struct drm_property *rotation_property; + +/* Legacy FB Plane gamma size for reporting to userspace */ +uint32_t gamma_size; +uint16_t *gamma_store; };#define obj_to_plane (x) container_of(x, struct drm_plane, base)Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 06/10] drm: Define helper to set legacy gamma table size
In reply to Daniele CastagnaHi Daniele,
Quoted 10 lines · Daniele Castagna
From: "uma.shankar at intel.com (Uma Shankar)" <[email protected]>
Define a helper function to set legacy gamma table size for planes.
(am from https://patchwork.kernel.org/patch/9971343/)
Change-Id: I3d0c3e71d92300259cdfcebed4349207f64e4083
Signed-off-by: Uma Shankar <uma.shankar at intel.com>
---
Daniel V has made a very good point in the cover letter. With that resolved there's a few small suggestions:
- please correct Uma's email - something has gone very wrong
- drop the "am from ..." and Change-Id lines - they're not applicable
in upstream development, AFAICT
- include your s-o-b when submitting patches - see the documentation
for details [1]
HTH
Emil
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v4.16-rc3#n429
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 7/10 drm/rockchip: Add yuv2yuv registers to vop_lit
In reply to Daniele Castagnark3399_vop_yuv2yuv registers can be used also by vop_lit (less capable crtc) to control per-plane color conversion pipeline.
Change-Id: Iaad1efeae7141959c61e976988bd9d699ce3858f
--- drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +1 -0
@@ -483,6 +483,7 @@ static const struct vop_data rk3399_vop_lit = { .modeset = &rk3288_modeset, .output = &rk3399_output, .misc = &rk3368_misc, + .yuv2yuv = &rk3399_vop_yuv2yuv, .win = rk3399_vop_lit_win_data, .win_size = ARRAY_SIZE(rk3399_vop_lit_win_data), };
Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 07/10] drm/rockchip: Add yuv2yuv registers to vop_lit
Quoted 4 lines · Daniele Castagna
rk3399_vop_yuv2yuvregisters can be used also byvop_lit(less capable crtc) to control per-plane color conversion pipeline.Change-Id: Iaad1efeae7141959c61e976988bd9d699ce3858f
Missing Signed-off-by, but this can probably get squashed into the earlier patch where the structure is introduced.
Sean
Quoted 23 lines
--- drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/rockchip/rockchip_vop_reg.c +1
-0@@ -483,6 +483,7 @@ static const struct vop_data rk3399_vop_lit = { .modeset = &rk3288_modeset, .output = &rk3399_output, .misc = &rk3368_misc, + .yuv2yuv = &rk3399_vop_yuv2yuv, .win = rk3399_vop_lit_win_data, .win_size = ARRAY_SIZE(rk3399_vop_lit_win_data), };Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 8/10 drm/rockchip: Add R2R registers
In reply to Daniele CastagnaThis patch adds YUV2YUV registers to enable and control per-plane RGB2RGB colos space conversion matrix.
Change-Id: I8f421222da3587caea6373e2201e918f0c5e2646
--- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 7 +++ drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 48 +++++++++++++++++++++ 2 files changed, 55 insertions(+)
drivers/gpu/drm/rockchip/rockchip_drm_vop.h +7 -0
@@ -80,6 +80,13 @@ struct vop_misc { };struct vop_yuv2yuv { +struct vop_reg win0_r2r_en; +struct vop_reg win0_r2r_coefficients[12 ]; +struct vop_reg win1_r2r_en; +struct vop_reg win1_r2r_coefficients[12 ]; +struct vop_reg win2_r2r_en; +struct vop_reg win2_r2r_coefficients[12 ]; +struct vop_reg win0_y2r_en;struct vop_reg win0_y2r_coefficients[12 ];
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +48 -0
54 lines not on this page · raw message
Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 08/10] drm/rockchip: Add R2R registers
Quoted 4 lines · Daniele Castagna
This patch adds YUV2YUV registers to enable and control per-plane RGB2RGB colos space conversion matrix.
Change-Id: I8f421222da3587caea6373e2201e918f0c5e2646
Missing Signed-off-by, I think you can squash this into "drm/rockchip: Implement drm plane->ctm property" as well.
Quoted 12 lines
--- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 7 +++ drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 48 +++++++++++++++++++++ 2 files changed, 55 insertions(+)drivers/gpu/drm/rockchip/rockchip_drm_vop.h +0
-0@@ -80,6 +80,13 @@ struct vop_misc { };
drivers/gpu/drm/rockchip/rockchip_drm_vop.h struct vop_misc { · line 91
Quoted 10 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.h +7
-0struct vop_yuv2yuv { +struct vop_reg win0_r2r_en; +struct vop_reg win0_r2r_coefficients[12 ]; +struct vop_reg win1_r2r_en; +struct vop_reg win1_r2r_coefficients[12 ]; +struct vop_reg win2_r2r_en; +struct vop_reg win2_r2r_coefficients[12 ]; +struct vop_reg win0_y2r_en;struct vop_reg win0_y2r_coefficients[12 ];
I'll revise my earlier feedback and propose:
#define NUM_CSC_COEFFICIENTS 12 #define NUM_R2R_WINDOWS 3 #define NUM_Y2R_WINDOWS 2
struct vop_csc_reg {
struct vop_reg en;
struct vop_reg coefficients[NUM_CSC_COEFFICIENTS];
};struct vop_csc {
struct vop_csc_reg r2r[NUM_R2R_WINDOWS];
struct vop_csc_reg y2r[NUM_Y2R_WINDOWS];
};Quoted 67 lines
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +48
-0@@ -423,6 +423,54 @@ static const struct vop_output rk3399_output = { };static const struct vop_yuv2yuv rk3399_vop_yuv2yuv = { + .win0_r2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,0 ), + .win0_r2r_coefficients = { +VOP_REG (RK3399_WIN0_YUV2YUV_3X3 +0 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_3X3 +0 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_3X3 +4 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_3X3 +4 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_3X3 +8 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_3X3 +8 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_3X3 +12 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_3X3 +12 ,0xffff ,16 ), +VOP_REG (RK3399_WIN0_YUV2YUV_3X3 +16 ,0xffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_3X3 +20 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_3X3 +24 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN0_YUV2YUV_3X3 +28 ,0xffffffff ,0 ), + }, + + .win1_r2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,8 ), + .win1_r2r_coefficients = { +VOP_REG (RK3399_WIN1_YUV2YUV_3X3 +0 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_3X3 +0 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_3X3 +4 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_3X3 +4 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_3X3 +8 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_3X3 +8 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_3X3 +12 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_3X3 +12 ,0xffff ,16 ), +VOP_REG (RK3399_WIN1_YUV2YUV_3X3 +16 ,0xffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_3X3 +20 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_3X3 +24 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN1_YUV2YUV_3X3 +28 ,0xffffffff ,0 ), + }, + + .win2_r2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,16 ), + .win2_r2r_coefficients = { +VOP_REG (RK3399_WIN2_YUV2YUV_3X3 +0 ,0xffff ,0 ), +VOP_REG (RK3399_WIN2_YUV2YUV_3X3 +0 ,0xffff ,16 ), +VOP_REG (RK3399_WIN2_YUV2YUV_3X3 +4 ,0xffff ,0 ), +VOP_REG (RK3399_WIN2_YUV2YUV_3X3 +4 ,0xffff ,16 ), +VOP_REG (RK3399_WIN2_YUV2YUV_3X3 +8 ,0xffff ,0 ), +VOP_REG (RK3399_WIN2_YUV2YUV_3X3 +8 ,0xffff ,16 ), +VOP_REG (RK3399_WIN2_YUV2YUV_3X3 +12 ,0xffff ,0 ), +VOP_REG (RK3399_WIN2_YUV2YUV_3X3 +12 ,0xffff ,16 ), +VOP_REG (RK3399_WIN2_YUV2YUV_3X3 +16 ,0xffff ,0 ), +VOP_REG (RK3399_WIN2_YUV2YUV_3X3 +20 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN2_YUV2YUV_3X3 +24 ,0xffffffff ,0 ), +VOP_REG (RK3399_WIN2_YUV2YUV_3X3 +28 ,0xffffffff ,0 ), + }, + .win0_y2r_en =VOP_REG (RK3399_YUV2YUV_WIN ,0x1 ,1 ), .win0_y2r_coefficients = {VOP_REG (RK3399_WIN1_YUV2YUV_Y2R +0 ,0xffff ,0 ),Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 9/10 drm/rockchip: Implement drm plane->ctm property.
In reply to Daniele CastagnaValidate drm PLANE_CTM matrix and map it to YUV2YUV registers.
Change-Id: Ib4fe49558c6266bf0c310af121d625cd7b2cedf6
--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 45 +++++++++++++++++++++ 1 file changed, 45 insertions(+)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +45 -0
@@ -656,6 +656,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *fb = state->fb;struct vop_win *vop_win =to_vop_win (plane);const struct vop_win_data *win = vop_win->data; +int i;int ret;struct drm_rect clip; int min_scale = win->phy->scl ? FRAC_16_16(1, 8) :
@@ -697,6 +698,25 @@ static int vop_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } +if (state->ctm) { +struct drm_color_ctm * color_ctm = (struct drm_color_ctm *)state->ctm->data; +if (state->ctm->length !=sizeof (struct drm_color_ctm )) { +DRM_ERROR ("Invalid PLANE_CTM blob size.\n" ); +return -EINVAL ; + } + +for (i =0 ; i <9 ; i++) { +/* +* YUV2YUV R2R registers have a signed fixed point S2.10 format. +* The input values, that are in signed fixed point S31.32 format, +* can be converted only if the first 30 MSBs are all 1s or 0s. +*/ +uint32_t msbs = (uint32_t ) (color_ctm->matrix[i] >>34 ); +if (msbs != ~0u && msbs !=0 ) +return -EOVERFLOW ; + } + } +return 0 ; }
@@ -816,6 +836,31 @@ static void vop_plane_atomic_update(struct drm_plane *plane, } } +if (!win_index) { +VOP_YUV2YUV_SET (vop, win0_r2r_en, !!state->ctm); + }else if (win_index ==1 ) { +VOP_YUV2YUV_SET (vop, win1_r2r_en, !!state->ctm); + }else if (win_index ==2 ) { +VOP_YUV2YUV_SET (vop, win2_r2r_en, !!state->ctm); + } +if (state->ctm) { +struct drm_color_ctm * color_ctm = (struct drm_color_ctm *)state->ctm->data; +/* +* Convert matrix values from fixed point S31.32 to S2.10, by discarding +* the lowest 22 bits. +*/ +for (i =0 ; i <9 ; i++) { +uint32_t value = (color_ctm->matrix[i] >>22 ) &0x1FFF ; +if (!win_index) { +VOP_YUV2YUV_SET (vop, win0_r2r_coefficients[i], value); + }else if (win_index ==1 ){ +VOP_YUV2YUV_SET (vop, win1_r2r_coefficients[i], value); + }else if (win_index ==2 ) { +VOP_YUV2YUV_SET (vop, win2_r2r_coefficients[i], value); + } + } + } +if (win->phy->scl) scl_vop_cal_scl_fac(vop, win, actual_w, actual_h, drm_rect_width(dest), drm_rect_height(dest),
Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 09/10] drm/rockchip: Implement drm plane->ctm property.
Quoted 3 lines · Daniele Castagna
Validate drm
PLANE_CTMmatrix and map it to YUV2YUV registers.Change-Id: Ib4fe49558c6266bf0c310af121d625cd7b2cedf6
Missing Signed-off-by
Quoted 18 lines
--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 45 +++++++++++++++++++++ 1 file changed, 45 insertions(+)drivers/gpu/drm/rockchip/rockchip_drm_vop.c +1
-0@@ -656,6 +656,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *fb = state->fb;struct vop_win *vop_win =to_vop_win (plane);const struct vop_win_data *win = vop_win->data; +int i;int ret;struct drm_rect clip; int min_scale = win->phy->scl ? FRAC_16_16(1, 8) :@@ -697,6 +698,25 @@ static int vop_plane_atomic_check(struct drm_plane *plane,return -EINVAL ;
drivers/gpu/drm/rockchip/rockchip_drm_vop.c static int vop_plane_atomic_check(struct drm_plane *plane, · line 708
Quoted 10 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +8
-0} +if (state->ctm) { +struct drm_color_ctm * color_ctm = (struct drm_color_ctm *)state->ctm->data; +if (state->ctm->length !=sizeof (struct drm_color_ctm )) { +DRM_ERROR ("Invalid PLANE_CTM blob size.\n" ); +return -EINVAL ; + } + +for (i =0 ; i <9 ; i++) {
s/9/ARRAY_SIZE(color_ctm->matrix)/
drivers/gpu/drm/rockchip/rockchip_drm_vop.c static int vop_plane_atomic_check(struct drm_plane *plane, · line 714
Quoted 6 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +6
-0+/* +* YUV2YUV R2R registers have a signed fixed point S2.10 format. +* The input values, that are in signed fixed point S31.32 format, +* can be converted only if the first 30 MSBs are all 1s or 0s. +*/ +uint32_t msbs = (uint32_t ) (color_ctm->matrix[i] >>34 );
The behavior of a negative value shift is implementation-defined, so probably best not to use it.
You could do:
uint64_t mask = GENMASK_ULL(63, 34);uint64_t msbs = (uint64_t)color_ctm->matrix[i] & mask;
if (msbs == 0 || msbs == mask)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c static int vop_plane_atomic_check(struct drm_plane *plane, · line 716
Quoted 2 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +2
-0+if (msbs != ~0u && msbs !=0 ) +return -EOVERFLOW ;
Indent is off here.
Quoted 10 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +3
-0+ } + } +return 0 ; }@@ -816,6 +836,31 @@ static void vop_plane_atomic_update(struct drm_plane *plane, } }
drivers/gpu/drm/rockchip/rockchip_drm_vop.c static void vop_plane_atomic_update(struct drm_plane *plane, · line 848
Quoted 10 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +10
-0+if (!win_index) { +VOP_YUV2YUV_SET (vop, win0_r2r_en, !!state->ctm); + }else if (win_index ==1 ) { +VOP_YUV2YUV_SET (vop, win1_r2r_en, !!state->ctm); + }else if (win_index ==2 ) { +VOP_YUV2YUV_SET (vop, win2_r2r_en, !!state->ctm); + } +if (state->ctm) { +struct drm_color_ctm * color_ctm = (struct drm_color_ctm *)state->ctm->data; +/*
Indent is messed up here too
drivers/gpu/drm/rockchip/rockchip_drm_vop.c static void vop_plane_atomic_update(struct drm_plane *plane, · line 853
Quoted 5 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +5
-0+* Convert matrix values from fixed point S31.32 to S2.10, by discarding +* the lowest 22 bits. +*/ +for (i =0 ; i <9 ; i++) { +uint32_t value = (color_ctm->matrix[i] >>22 ) &0x1FFF ;
Same comment regarding the shift here, best to cast and mask before shifting.
Quoted 20 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +10
-0+if (!win_index) { +VOP_YUV2YUV_SET (vop, win0_r2r_coefficients[i], value); + }else if (win_index ==1 ){ +VOP_YUV2YUV_SET (vop, win1_r2r_coefficients[i], value); + }else if (win_index ==2 ) { +VOP_YUV2YUV_SET (vop, win2_r2r_coefficients[i], value); + } + } + } +if (win->phy->scl) scl_vop_cal_scl_fac(vop, win, actual_w, actual_h, drm_rect_width(dest), drm_rect_height(dest),Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 10/10 drm/rockchip: Enable 'PLANE_CTM' drm property.
In reply to Daniele CastagnaEnable and expose 'PLANE_CTM' matrix on primary and overaly planes. The property can be use to set a RGB to RGB 3X3 color conversion matrix that will be applied to planes at scanout.
Change-Id: Ifb7a680ab84c17557b8b3c5aaba1aa3b4eecfcaa
--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +5 -0
@@ -1352,6 +1352,9 @@ static int vop_create_crtc(struct vop *vop) ret =drm_crtc_init_with_planes (drm_dev, crtc, primary, cursor, &vop_crtc_funcs,NULL ); + +drm_plane_enable_color_mgmt (primary,0 , true,0 ); +if (ret) goto err_cleanup_planes;
@@ -1381,6 +1384,8 @@ static int vop_create_crtc(struct vop *vop) goto err_cleanup_crtc; }drm_plane_helper_add (&vop_win->base, &plane_helper_funcs); + +drm_plane_enable_color_mgmt (&vop_win->base,0 , true,0 ); } port =of_get_child_by_name (dev->of_node,"port" );
Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 10/10] drm/rockchip: Enable 'PLANE_CTM' drm property.
Quoted 5 lines · Daniele Castagna
Enable and expose '
PLANE_CTM' matrix on primary and overaly planes. The property can be use to set a RGB to RGB 3X3 color conversion matrix that will be applied to planes at scanout.Change-Id: Ifb7a680ab84c17557b8b3c5aaba1aa3b4eecfcaa
Once you add the missing SoB,
Quoted 34 lines
--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/rockchip/rockchip_drm_vop.c +5
-0@@ -1352,6 +1352,9 @@ static int vop_create_crtc(struct vop *vop) ret =drm_crtc_init_with_planes (drm_dev, crtc, primary, cursor, &vop_crtc_funcs,NULL ); + +drm_plane_enable_color_mgmt (primary,0 , true,0 ); +if (ret) goto err_cleanup_planes;@@ -1381,6 +1384,8 @@ static int vop_create_crtc(struct vop *vop) goto err_cleanup_crtc; }drm_plane_helper_add (&vop_win->base, &plane_helper_funcs); + +drm_plane_enable_color_mgmt (&vop_win->base,0 , true,0 ); } port =of_get_child_by_name (dev->of_node,"port" );Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 14 lines · Daniele Castagna
Hello,
this patch series adds a per plane color matrix property as well as an implementation for rockchip.This patch series builds on and includes previous work done by uma.shankar:
https://lists.freedesktop.org/archives/dri-devel/2017-September/153347.htmlThe first rockchip patch of this series sets a BT.601 color conversion matrix for YUV formats and is included because it adds YUV2YUV registers that the rest of the color matrix rockchip implementation depends upon.
The next patches are the ones originally provided by uma.shankar, rebased and containing an additional small fix.
Quoted 6 lines
The final set of rockchip patches implement, and finally enable, the plane CTM property on rockchip.
These patches have been rebased on drm-next (
80daf42f97b1a0503d029f3c1325), Unfortunately I haven't been able to test them after rebasing because the display doesn't come up when I push a kernel built from drm-next on a device.
Link to the open source userspace making use of these new properties is missing. See
https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements
-Daniel
Quoted 35 lines
Daniele Castagna (5):
drm/rockchip: YUV overlays BT.601 color conversion. drm/rockchip: Add yuv2yuv registers tovop_litdrm/rockchip: Add R2R registers drm/rockchip: Implement drmplane->ctmproperty. drm/rockchip: Enable 'PLANE_CTM' drm property.uma.shankar at intel.com (Uma Shankar) (5):
drm: Add Plane Degamma properties
drm: Add Plane CTM property
drm: Add Plane Gamma properties
drm: Define helper function for plane color enabling
drm: Define helper to set legacy gamma table sizedrivers/gpu/drm/drm_atomic.c | 30 +++++++ drivers/gpu/drm/drm_atomic_helper.c | 14 ++++ drivers/gpu/drm/drm_color_mgmt.c | 41 ++++++++++ drivers/gpu/drm/drm_mode_config.c | 34 ++++++++ drivers/gpu/drm/drm_plane.c | 48 +++++++++++ drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 90 ++++++++++++++++++++- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 16 ++++ drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 88 +++++++++++++++++++- include/drm/drm_color_mgmt.h | 8 ++ include/drm/drm_mode_config.h | 27 +++++++ include/drm/drm_plane.h | 31 +++++++ 11 files changed, 424 insertions(+), 3 deletions(-)Signature · 6 lines
2.16.1.291.g4437f3f132-goog _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel