lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <veb4fyixov4wqlkpanbgxhd36shrqmsow5hpx4pji7mhfk5mxs@57mpolgixriz>
Date: Fri, 9 Feb 2024 16:37:09 +0100
From: Maxime Ripard <mripard@...nel.org>
To: Keith Zhao <keith.zhao@...rfivetech.com>
Cc: "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>, 
	"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, 
	"linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>, "tzimmermann@...e.de" <tzimmermann@...e.de>, 
	"airlied@...il.com" <airlied@...il.com>, 
	"krzysztof.kozlowski+dt@...aro.org" <krzysztof.kozlowski+dt@...aro.org>, William Qiu <william.qiu@...rfivetech.com>, 
	Xingyu Wu <xingyu.wu@...rfivetech.com>, "paul.walmsley@...ive.com" <paul.walmsley@...ive.com>, 
	"aou@...s.berkeley.edu" <aou@...s.berkeley.edu>, "palmer@...belt.com" <palmer@...belt.com>, 
	"p.zabel@...gutronix.de" <p.zabel@...gutronix.de>, Shengyang Chen <shengyang.chen@...rfivetech.com>, 
	Jack Zhu <jack.zhu@...rfivetech.com>, Changhuang Liang <changhuang.liang@...rfivetech.com>, 
	"maarten.lankhorst@...ux.intel.com" <maarten.lankhorst@...ux.intel.com>
Subject: Re: RE: [v3 4/6] drm/vs: Add KMS crtc&plane

On Thu, Feb 01, 2024 at 02:22:16AM +0000, Keith Zhao wrote:
> 
> 
> 
> 
> > -----Original Message-----
> 
> > From: Maxime Ripard <mripard@...nel.org>
> 
> > Sent: 2024年1月31日 21:24
> 
> > To: Keith Zhao <keith.zhao@...rfivetech.com>
> 
> > Cc: devicetree@...r.kernel.org; dri-devel@...ts.freedesktop.org;
> 
> > linux-kernel@...r.kernel.org; linux-riscv@...ts.infradead.org;
> 
> > tzimmermann@...e.de; airlied@...il.com; krzysztof.kozlowski+dt@...aro.org;
> 
> > William Qiu <william.qiu@...rfivetech.com>; Xingyu Wu
> 
> > <xingyu.wu@...rfivetech.com>; paul.walmsley@...ive.com;
> 
> > aou@...s.berkeley.edu; palmer@...belt.com; p.zabel@...gutronix.de;
> 
> > Shengyang Chen <shengyang.chen@...rfivetech.com>; Jack Zhu
> 
> > <jack.zhu@...rfivetech.com>; Changhuang Liang
> 
> > <changhuang.liang@...rfivetech.com>; maarten.lankhorst@...ux.intel.com
> 
> > Subject: Re: [v3 4/6] drm/vs: Add KMS crtc&plane
> 
> >
> 
> > On Wed, Jan 31, 2024 at 09:33:06AM +0000, Keith Zhao wrote:
> 
> > >
> 
> > >
> 
> > > > -----邮件原件-----
> 
> > > > 发件人: Maxime Ripard <mripard@...nel.org<mailto:mripard@...nel.org>>
> 
> > > > 发送时间: 2023年12月6日 16:56
> 
> > > > 收件人: Keith Zhao <keith.zhao@...rfivetech.com<mailto:keith.zhao@...rfivetech.com>>
> 
> > > > 抄送: devicetree@...r.kernel.org<mailto:devicetree@...r.kernel.org>; dri-devel@...ts.freedesktop.org<mailto:dri-devel@...ts.freedesktop.org>;
> 
> > > > linux-kernel@...r.kernel.org<mailto:linux-kernel@...r.kernel.org>; linux-riscv@...ts.infradead.org<mailto:linux-riscv@...ts.infradead.org>;
> 
> > > > tzimmermann@...e.de<mailto:tzimmermann@...e.de>; airlied@...il.com<mailto:airlied@...il.com>;
> 
> > > > krzysztof.kozlowski+dt@...aro.org<mailto:krzysztof.kozlowski+dt@...aro.org>;
> 
> > > > William Qiu <william.qiu@...rfivetech.com<mailto:william.qiu@...rfivetech.com>>; Xingyu Wu
> 
> > > > <xingyu.wu@...rfivetech.com<mailto:xingyu.wu@...rfivetech.com>>; paul.walmsley@...ive.com<mailto:paul.walmsley@...ive.com>;
> 
> > > > aou@...s.berkeley.edu<mailto:aou@...s.berkeley.edu>; palmer@...belt.com<mailto:palmer@...belt.com>; p.zabel@...gutronix.de<mailto:p.zabel@...gutronix.de>;
> 
> > > > Shengyang Chen <shengyang.chen@...rfivetech.com<mailto:shengyang.chen@...rfivetech.com>>; Jack Zhu
> 
> > > > <jack.zhu@...rfivetech.com<mailto:jack.zhu@...rfivetech.com>>; Changhuang Liang
> 
> > > > <changhuang.liang@...rfivetech.com<mailto:changhuang.liang@...rfivetech.com>>;
> 
> > > > maarten.lankhorst@...ux.intel.com<mailto:maarten.lankhorst@...ux.intel.com>;
> 
> > > > suijingfeng@...ngson.cn<mailto:suijingfeng@...ngson.cn>
> 
> > > > 主题: Re: [v3 4/6] drm/vs: Add KMS crtc&plane
> 
> > > >
> 
> > > > On Mon, Dec 04, 2023 at 08:33:13PM +0800, Keith Zhao wrote:
> 
> > > > > +static const struct vs_plane_info dc_hw_planes_rev0[PLANE_NUM] = {
> 
> > > > > +   {
> 
> > > > > +            .name                         = "Primary",
> 
> > > > > +            .id                       = PRIMARY_PLANE_0,
> 
> > > > > +            .type                            = DRM_PLANE_TYPE_PRIMARY,
> 
> > > > > +            .num_formats           = ARRAY_SIZE(primary_overlay_format0),
> 
> > > > > +            .formats            = primary_overlay_format0,
> 
> > > > > +            .num_modifiers                 = ARRAY_SIZE(format_modifier0),
> 
> > > > > +            .modifiers                   = format_modifier0,
> 
> > > > > +            .min_width                = 0,
> 
> > > > > +            .min_height               = 0,
> 
> > > > > +            .max_width               = 4096,
> 
> > > > > +            .max_height              = 4096,
> 
> > > > > +            .rotation           = DRM_MODE_ROTATE_0 |
> 
> > > > > +                                          DRM_MODE_ROTATE_90 |
> 
> > > > > +                                          DRM_MODE_ROTATE_180 |
> 
> > > > > +                                          DRM_MODE_ROTATE_270 |
> 
> > > > > +                                          DRM_MODE_REFLECT_X |
> 
> > > > > +                                          DRM_MODE_REFLECT_Y,
> 
> > > > > +            .blend_mode             = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
> 
> > > > > +                                          BIT(DRM_MODE_BLEND_PREMULTI) |
> 
> > > > > +                                          BIT(DRM_MODE_BLEND_COVERAGE),
> 
> > > > > +            .color_encoding                 = BIT(DRM_COLOR_YCBCR_BT709) |
> 
> > > > > +                                          BIT(DRM_COLOR_YCBCR_BT2020),
> 
> > > > > +            .degamma_size                  = DEGAMMA_SIZE,
> 
> > > > > +            .min_scale                 = FRAC_16_16(1, 3),
> 
> > > > > +            .max_scale                = FRAC_16_16(10, 1),
> 
> > > > > +            .zpos                            = 0,
> 
> > > > > +            .watermark               = true,
> 
> > > > > +            .color_mgmt             = true,
> 
> > > > > +            .roi                      = true,
> 
> > > > > +   },
> 
> > > > > +   {
> 
> > > > > +            .name                         = "Overlay",
> 
> > > > > +            .id                       = OVERLAY_PLANE_0,
> 
> > > > > +            .type                            = DRM_PLANE_TYPE_OVERLAY,
> 
> > > > > +            .num_formats           = ARRAY_SIZE(primary_overlay_format0),
> 
> > > > > +            .formats            = primary_overlay_format0,
> 
> > > > > +            .num_modifiers                 = ARRAY_SIZE(format_modifier0),
> 
> > > > > +            .modifiers                   = format_modifier0,
> 
> > > > > +            .min_width                = 0,
> 
> > > > > +            .min_height               = 0,
> 
> > > > > +            .max_width               = 4096,
> 
> > > > > +            .max_height              = 4096,
> 
> > > > > +            .rotation           = DRM_MODE_ROTATE_0 |
> 
> > > > > +                                          DRM_MODE_ROTATE_90 |
> 
> > > > > +                                          DRM_MODE_ROTATE_180 |
> 
> > > > > +                                          DRM_MODE_ROTATE_270 |
> 
> > > > > +                                          DRM_MODE_REFLECT_X |
> 
> > > > > +                                          DRM_MODE_REFLECT_Y,
> 
> > > > > +            .blend_mode             = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
> 
> > > > > +                                          BIT(DRM_MODE_BLEND_PREMULTI) |
> 
> > > > > +                                          BIT(DRM_MODE_BLEND_COVERAGE),
> 
> > > > > +            .color_encoding                 = BIT(DRM_COLOR_YCBCR_BT709) |
> 
> > > > > +                                          BIT(DRM_COLOR_YCBCR_BT2020),
> 
> > > > > +            .degamma_size                  = DEGAMMA_SIZE,
> 
> > > > > +            .min_scale                 = FRAC_16_16(1, 3),
> 
> > > > > +            .max_scale                = FRAC_16_16(10, 1),
> 
> > > > > +            .zpos                            = 1,
> 
> > > > > +            .watermark               = true,
> 
> > > > > +            .color_mgmt             = true,
> 
> > > > > +            .roi                      = true,
> 
> > > > > +   },
> 
> > > > > +   {
> 
> > > > > +            .name                         = "Overlay_1",
> 
> > > > > +            .id                       = OVERLAY_PLANE_1,
> 
> > > > > +            .type                            = DRM_PLANE_TYPE_OVERLAY,
> 
> > > > > +            .num_formats           = ARRAY_SIZE(primary_overlay_format0),
> 
> > > > > +            .formats            = primary_overlay_format0,
> 
> > > > > +            .num_modifiers                 =
> 
> > ARRAY_SIZE(secondary_format_modifiers),
> 
> > > > > +            .modifiers                   = secondary_format_modifiers,
> 
> > > > > +            .min_width                = 0,
> 
> > > > > +            .min_height               = 0,
> 
> > > > > +            .max_width               = 4096,
> 
> > > > > +            .max_height              = 4096,
> 
> > > > > +            .rotation           = 0,
> 
> > > > > +            .blend_mode             = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
> 
> > > > > +                                          BIT(DRM_MODE_BLEND_PREMULTI) |
> 
> > > > > +                                          BIT(DRM_MODE_BLEND_COVERAGE),
> 
> > > > > +            .color_encoding                 = BIT(DRM_COLOR_YCBCR_BT709) |
> 
> > > > > +                                          BIT(DRM_COLOR_YCBCR_BT2020),
> 
> > > > > +            .degamma_size                  = DEGAMMA_SIZE,
> 
> > > > > +            .min_scale                 = DRM_PLANE_NO_SCALING,
> 
> > > > > +            .max_scale                = DRM_PLANE_NO_SCALING,
> 
> > > > > +            .zpos                            = 2,
> 
> > > > > +            .watermark               = true,
> 
> > > > > +            .color_mgmt             = true,
> 
> > > > > +            .roi                      = true,
> 
> > > > > +   },
> 
> > > > > +   {
> 
> > > > > +            .name                         = "Primary_1",
> 
> > > > > +            .id                       = PRIMARY_PLANE_1,
> 
> > > > > +            .type                            = DRM_PLANE_TYPE_PRIMARY,
> 
> > > > > +            .num_formats           = ARRAY_SIZE(primary_overlay_format0),
> 
> > > > > +            .formats            = primary_overlay_format0,
> 
> > > > > +            .num_modifiers                 = ARRAY_SIZE(format_modifier0),
> 
> > > > > +            .modifiers                   = format_modifier0,
> 
> > > > > +            .min_width                = 0,
> 
> > > > > +            .min_height               = 0,
> 
> > > > > +            .max_width               = 4096,
> 
> > > > > +            .max_height              = 4096,
> 
> > > > > +            .rotation           = DRM_MODE_ROTATE_0 |
> 
> > > > > +                                          DRM_MODE_ROTATE_90 |
> 
> > > > > +                                          DRM_MODE_ROTATE_180 |
> 
> > > > > +                                          DRM_MODE_ROTATE_270 |
> 
> > > > > +                                          DRM_MODE_REFLECT_X |
> 
> > > > > +                                          DRM_MODE_REFLECT_Y,
> 
> > > > > +            .blend_mode             = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
> 
> > > > > +                                          BIT(DRM_MODE_BLEND_PREMULTI) |
> 
> > > > > +                                          BIT(DRM_MODE_BLEND_COVERAGE),
> 
> > > > > +            .color_encoding                 = BIT(DRM_COLOR_YCBCR_BT709) |
> 
> > > > > +                                          BIT(DRM_COLOR_YCBCR_BT2020),
> 
> > > > > +            .degamma_size                  = DEGAMMA_SIZE,
> 
> > > > > +            .min_scale                 = FRAC_16_16(1, 3),
> 
> > > > > +            .max_scale                = FRAC_16_16(10, 1),
> 
> > > > > +            .zpos                            = 3,
> 
> > > > > +            .watermark               = true,
> 
> > > > > +            .color_mgmt             = true,
> 
> > > > > +            .roi                      = true,
> 
> > > > > +   },
> 
> > > > > +   {
> 
> > > > > +            .name                         = "Overlay_2",
> 
> > > > > +            .id                       = OVERLAY_PLANE_2,
> 
> > > > > +            .type                            = DRM_PLANE_TYPE_OVERLAY,
> 
> > > > > +            .num_formats           = ARRAY_SIZE(primary_overlay_format0),
> 
> > > > > +            .formats            = primary_overlay_format0,
> 
> > > > > +            .num_modifiers                 = ARRAY_SIZE(format_modifier0),
> 
> > > > > +            .modifiers                   = format_modifier0,
> 
> > > > > +            .min_width                = 0,
> 
> > > > > +            .min_height               = 0,
> 
> > > > > +            .max_width               = 4096,
> 
> > > > > +            .max_height              = 4096,
> 
> > > > > +            .rotation           = DRM_MODE_ROTATE_0 |
> 
> > > > > +                                          DRM_MODE_ROTATE_90 |
> 
> > > > > +                                          DRM_MODE_ROTATE_180 |
> 
> > > > > +                                          DRM_MODE_ROTATE_270 |
> 
> > > > > +                                          DRM_MODE_REFLECT_X |
> 
> > > > > +                                          DRM_MODE_REFLECT_Y,
> 
> > > > > +            .blend_mode             = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
> 
> > > > > +                                          BIT(DRM_MODE_BLEND_PREMULTI) |
> 
> > > > > +                                          BIT(DRM_MODE_BLEND_COVERAGE),
> 
> > > > > +            .color_encoding                 = BIT(DRM_COLOR_YCBCR_BT709) |
> 
> > > > > +                                          BIT(DRM_COLOR_YCBCR_BT2020),
> 
> > > > > +            .degamma_size                  = DEGAMMA_SIZE,
> 
> > > > > +            .min_scale                 = FRAC_16_16(1, 3),
> 
> > > > > +            .max_scale                = FRAC_16_16(10, 1),
> 
> > > > > +            .zpos                            = 4,
> 
> > > > > +            .watermark               = true,
> 
> > > > > +            .color_mgmt             = true,
> 
> > > > > +            .roi                      = true,
> 
> > > > > +   },
> 
> > > > > +   {
> 
> > > > > +            .name                         = "Overlay_3",
> 
> > > > > +            .id                       = OVERLAY_PLANE_3,
> 
> > > > > +            .type                            = DRM_PLANE_TYPE_OVERLAY,
> 
> > > > > +            .num_formats           = ARRAY_SIZE(primary_overlay_format0),
> 
> > > > > +            .formats            = primary_overlay_format0,
> 
> > > > > +            .num_modifiers                 =
> 
> > ARRAY_SIZE(secondary_format_modifiers),
> 
> > > > > +            .modifiers                   = secondary_format_modifiers,
> 
> > > > > +            .min_width                = 0,
> 
> > > > > +            .min_height               = 0,
> 
> > > > > +            .max_width               = 4096,
> 
> > > > > +            .max_height              = 4096,
> 
> > > > > +            .rotation           = 0,
> 
> > > > > +            .blend_mode             = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
> 
> > > > > +                                          BIT(DRM_MODE_BLEND_PREMULTI) |
> 
> > > > > +                                          BIT(DRM_MODE_BLEND_COVERAGE),
> 
> > > > > +            .color_encoding                 = BIT(DRM_COLOR_YCBCR_BT709) |
> 
> > > > > +                                          BIT(DRM_COLOR_YCBCR_BT2020),
> 
> > > > > +            .degamma_size                  = DEGAMMA_SIZE,
> 
> > > > > +            .min_scale                 = DRM_PLANE_NO_SCALING,
> 
> > > > > +            .max_scale                = DRM_PLANE_NO_SCALING,
> 
> > > > > +            .zpos                            = 5,
> 
> > > > > +            .watermark               = true,
> 
> > > > > +            .color_mgmt             = true,
> 
> > > > > +            .roi                      = true,
> 
> > > > > +   },
> 
> > > > > +   {
> 
> > > > > +            .name                         = "Cursor",
> 
> > > > > +            .id                       = CURSOR_PLANE_0,
> 
> > > > > +            .type                            = DRM_PLANE_TYPE_CURSOR,
> 
> > > > > +            .num_formats           = ARRAY_SIZE(cursor_formats),
> 
> > > > > +            .formats            = cursor_formats,
> 
> > > > > +            .num_modifiers                 = 0,
> 
> > > > > +            .modifiers                   = NULL,
> 
> > > > > +            .min_width                = 32,
> 
> > > > > +            .min_height               = 32,
> 
> > > > > +            .max_width               = 64,
> 
> > > > > +            .max_height              = 64,
> 
> > > > > +            .rotation           = 0,
> 
> > > > > +            .degamma_size                  = 0,
> 
> > > > > +            .min_scale                 = DRM_PLANE_NO_SCALING,
> 
> > > > > +            .max_scale                = DRM_PLANE_NO_SCALING,
> 
> > > > > +            .zpos                            = 255,
> 
> > > > > +            .watermark               = false,
> 
> > > > > +            .color_mgmt             = false,
> 
> > > > > +            .roi                      = false,
> 
> > > > > +   },
> 
> > > > > +   {
> 
> > > > > +            .name                         = "Cursor_1",
> 
> > > > > +            .id                       = CURSOR_PLANE_1,
> 
> > > > > +            .type                            = DRM_PLANE_TYPE_CURSOR,
> 
> > > > > +            .num_formats           = ARRAY_SIZE(cursor_formats),
> 
> > > > > +            .formats            = cursor_formats,
> 
> > > > > +            .num_modifiers                 = 0,
> 
> > > > > +            .modifiers                   = NULL,
> 
> > > > > +            .min_width                = 32,
> 
> > > > > +            .min_height               = 32,
> 
> > > > > +            .max_width               = 64,
> 
> > > > > +            .max_height              = 64,
> 
> > > > > +            .rotation           = 0,
> 
> > > > > +            .degamma_size                  = 0,
> 
> > > > > +            .min_scale                 = DRM_PLANE_NO_SCALING,
> 
> > > > > +            .max_scale                = DRM_PLANE_NO_SCALING,
> 
> > > > > +            .zpos                            = 255,
> 
> > > > > +            .watermark               = false,
> 
> > > > > +            .color_mgmt             = false,
> 
> > > > > +            .roi                      = false,
> 
> > > > > +   },
> 
> > > > > +};
> 
> > > > > +
> 
> > > > > +static const struct vs_dc_info dc8200_info = {
> 
> > > > > +   .name                         = "DC8200",
> 
> > > > > +   .panel_num               = 2,
> 
> > > > > +   .plane_num               = 8,
> 
> > > > > +   .planes                        = dc_hw_planes_rev0,
> 
> > > > > +   .layer_num                = 6,
> 
> > > > > +   .max_bpc          = 10,
> 
> > > > > +   .color_formats          = DRM_COLOR_FORMAT_RGB444 |
> 
> > > > > +                                 DRM_COLOR_FORMAT_YCBCR444 |
> 
> > > > > +                                 DRM_COLOR_FORMAT_YCBCR422 |
> 
> > > > > +                                 DRM_COLOR_FORMAT_YCBCR420,
> 
> > > > > +   .gamma_size             = GAMMA_EX_SIZE,
> 
> > > > > +   .gamma_bits             = 12,
> 
> > > > > +   .pitch_alignment     = 128,
> 
> > > > > +   .pipe_sync                  = false,
> 
> > > > > +   .background              = true,
> 
> > > > > +   .panel_sync               = true,
> 
> > > > > +   .cap_dec           = true,
> 
> > > > > +};
> 
> > > >
> 
> > > > I really think that entire thing is to workaround a suboptimal device tree
> 
> > binding.
> 
> > > > You should have two CRTCs in the device tree, you'll probe twice,
> 
> > > > and you won't get to do that whole dance.
> 
> > > >
> 
> >
> 
> > > I tried to modify it according to this idea Found it too difficult In
> 
> > > terms of hardware, the two crtc designs are too close to separate, and
> 
> > > they are even designed into the same reg with different bits
> 
> > > representing crtc0 and crtc1. It seems not easy to described the 2
> 
> > > ctrc hardware by 2 device nodes
> 
> >
> 
> > What are these bits doing?
> 
> 
> 
> [cid:image001.png@...A54F5.ECEA9C10]
> 
> For example:
> 
> like this , bit0 and bit1 match ctrc0 and crtc1 , it is used to start crtc
> 
> A similar situation exists for other register definitions.
> 
> 
> 
> Another case is that ctrc0 and crtc1 have the same function and their offset is continuous,
> 
> instead of crtc0 being a continuous area, crtc1 being a continuous area
> 
> reg:
> 
> crtc0 X
> 
> crtc1 X+4
> 
> crtc0 X+8
> 
> crtc1 X+12
> 
> if to make it two separate devices, the device node dts reg attribute would be complex

Yeah, ok, that makes sense then.

In which case, if we're going to have one big device in the DT with all
the planes and CRTCs, why do we need the display-subsystem device? Just
make your driver probe on the dc8200 device.

Maxime

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ