diff mbox series

[v4,05/10] drm/vs: add vs mode config init

Message ID 20240521105817.3301-6-keith.zhao@starfivetech.com (mailing list archive)
State New, archived
Headers show
Series drm/verisilicon : support DC8200 and inno hdmi | expand

Commit Message

Keith Zhao May 21, 2024, 10:58 a.m. UTC
add vs mode config base api

Signed-off-by: keith <keith.zhao@starfivetech.com>
---
 drivers/gpu/drm/verisilicon/Makefile     |  3 +-
 drivers/gpu/drm/verisilicon/vs_modeset.c | 36 ++++++++++++++++++++++++
 drivers/gpu/drm/verisilicon/vs_modeset.h | 10 +++++++
 3 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/verisilicon/vs_modeset.c
 create mode 100644 drivers/gpu/drm/verisilicon/vs_modeset.h

Comments

Dmitry Baryshkov May 21, 2024, 8:52 p.m. UTC | #1
On Tue, May 21, 2024 at 06:58:12PM +0800, keith wrote:
> add vs mode config base api

Commit message? Please describe e.g. why are you using
drm_atomic_helper_commit_tail_rpm() instead of
drm_atomic_helper_commit_tail().

> 
> Signed-off-by: keith <keith.zhao@starfivetech.com>

Name

> ---
>  drivers/gpu/drm/verisilicon/Makefile     |  3 +-
>  drivers/gpu/drm/verisilicon/vs_modeset.c | 36 ++++++++++++++++++++++++
>  drivers/gpu/drm/verisilicon/vs_modeset.h | 10 +++++++
>  3 files changed, 48 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/gpu/drm/verisilicon/vs_modeset.c
>  create mode 100644 drivers/gpu/drm/verisilicon/vs_modeset.h
> 
> diff --git a/drivers/gpu/drm/verisilicon/Makefile b/drivers/gpu/drm/verisilicon/Makefile
> index 7da54b259940..536091f37378 100644
> --- a/drivers/gpu/drm/verisilicon/Makefile
> +++ b/drivers/gpu/drm/verisilicon/Makefile
> @@ -1,5 +1,6 @@
>  # SPDX-License-Identifier: GPL-2.0
>  
> -vs_drm-objs := vs_dc_hw.o
> +vs_drm-objs := vs_dc_hw.o \
> +		vs_modeset.o
>  
>  obj-$(CONFIG_DRM_VERISILICON_DC8200) += vs_drm.o
> diff --git a/drivers/gpu/drm/verisilicon/vs_modeset.c b/drivers/gpu/drm/verisilicon/vs_modeset.c
> new file mode 100644
> index 000000000000..c71fe0d32504
> --- /dev/null
> +++ b/drivers/gpu/drm/verisilicon/vs_modeset.c
> @@ -0,0 +1,36 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (C) 2023 VeriSilicon Holdings Co., Ltd.
> + */
> +#include <drm/drm_damage_helper.h>

I don't see anything concerning damage helpers being used here.

> +#include <drm/drm_fb_helper.h>
> +#include <drm/drm_gem_framebuffer_helper.h>
> +
> +#include "vs_modeset.h"
> +
> +static const struct drm_mode_config_funcs vs_mode_config_funcs = {
> +	.fb_create			 = drm_gem_fb_create,
> +	.atomic_check		 = drm_atomic_helper_check,
> +	.atomic_commit		 = drm_atomic_helper_commit,
> +};
> +
> +static struct drm_mode_config_helper_funcs vs_mode_config_helpers = {
> +	.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
> +};
> +
> +void vs_mode_config_init(struct drm_device *dev)
> +{
> +	int ret;
> +
> +	ret = drmm_mode_config_init(dev);
> +	if (ret)
> +		return;
> +
> +	dev->mode_config.min_width  = 0;
> +	dev->mode_config.min_height = 0;
> +	dev->mode_config.max_width  = 4096;
> +	dev->mode_config.max_height = 4096;
> +
> +	dev->mode_config.funcs = &vs_mode_config_funcs;
> +	dev->mode_config.helper_private = &vs_mode_config_helpers;
> +}
> diff --git a/drivers/gpu/drm/verisilicon/vs_modeset.h b/drivers/gpu/drm/verisilicon/vs_modeset.h
> new file mode 100644
> index 000000000000..bd04f81d2ad2
> --- /dev/null
> +++ b/drivers/gpu/drm/verisilicon/vs_modeset.h
> @@ -0,0 +1,10 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Copyright (C) 2020 VeriSilicon Holdings Co., Ltd.
> + */
> +
> +#ifndef __VS_MODESET_H__
> +#define __VS_MODESET_H__
> +
> +void vs_mode_config_init(struct drm_device *dev);
> +#endif /* __VS_FB_H__ */
> -- 
> 2.27.0
>
Keith Zhao June 23, 2024, 7:17 a.m. UTC | #2
Hi Dmitry:

> -----Original Message-----
> From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Sent: 2024年5月22日 4:53
> To: Keith Zhao <keith.zhao@starfivetech.com>
> Cc: andrzej.hajda@intel.com; neil.armstrong@linaro.org; rfoss@kernel.org;
> Laurent.pinchart@ideasonboard.com; jonas@kwiboo.se;
> jernej.skrabec@gmail.com; maarten.lankhorst@linux.intel.com;
> mripard@kernel.org; tzimmermann@suse.de; airlied@gmail.com;
> daniel@ffwll.ch; robh@kernel.org; krzk+dt@kernel.org; conor+dt@kernel.org;
> hjc@rock-chips.com; heiko@sntech.de; andy.yan@rock-chips.com; Xingyu Wu
> <xingyu.wu@starfivetech.com>; p.zabel@pengutronix.de; Jack Zhu
> <jack.zhu@starfivetech.com>; Shengyang Chen
> <shengyang.chen@starfivetech.com>; dri-devel@lists.freedesktop.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org
> Subject: Re: [PATCH v4 05/10] drm/vs: add vs mode config init
> 
> On Tue, May 21, 2024 at 06:58:12PM +0800, keith wrote:
> > add vs mode config base api
> 
> Commit message? Please describe e.g. why are you using
> drm_atomic_helper_commit_tail_rpm() instead of
> drm_atomic_helper_commit_tail().
> 
> >
> > Signed-off-by: keith <keith.zhao@starfivetech.com>
> 
> Name
This can be modified.
> 
> > ---
> >  drivers/gpu/drm/verisilicon/Makefile     |  3 +-
> >  drivers/gpu/drm/verisilicon/vs_modeset.c | 36
> > ++++++++++++++++++++++++  drivers/gpu/drm/verisilicon/vs_modeset.h |
> > 10 +++++++
> >  3 files changed, 48 insertions(+), 1 deletion(-)  create mode 100644
> > drivers/gpu/drm/verisilicon/vs_modeset.c
> >  create mode 100644 drivers/gpu/drm/verisilicon/vs_modeset.h
> >
> > diff --git a/drivers/gpu/drm/verisilicon/Makefile
> > b/drivers/gpu/drm/verisilicon/Makefile
> > index 7da54b259940..536091f37378 100644
> > --- a/drivers/gpu/drm/verisilicon/Makefile
> > +++ b/drivers/gpu/drm/verisilicon/Makefile
> > @@ -1,5 +1,6 @@
> >  # SPDX-License-Identifier: GPL-2.0
> >
> > -vs_drm-objs := vs_dc_hw.o
> > +vs_drm-objs := vs_dc_hw.o \
> > +		vs_modeset.o
> >
> >  obj-$(CONFIG_DRM_VERISILICON_DC8200) += vs_drm.o diff --git
> > a/drivers/gpu/drm/verisilicon/vs_modeset.c
> > b/drivers/gpu/drm/verisilicon/vs_modeset.c
> > new file mode 100644
> > index 000000000000..c71fe0d32504
> > --- /dev/null
> > +++ b/drivers/gpu/drm/verisilicon/vs_modeset.c
> > @@ -0,0 +1,36 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Copyright (C) 2023 VeriSilicon Holdings Co., Ltd.
> > + */
> > +#include <drm/drm_damage_helper.h>
> 
> I don't see anything concerning damage helpers being used here.
> 
Yes , it should use drm_atomic_helper.h instead of drm_damage_helper.h

> > +#include <drm/drm_fb_helper.h>
> > +#include <drm/drm_gem_framebuffer_helper.h>
> > +
> > +#include "vs_modeset.h"
> > +
> > +static const struct drm_mode_config_funcs vs_mode_config_funcs = {
> > +	.fb_create			 = drm_gem_fb_create,
> > +	.atomic_check		 = drm_atomic_helper_check,
> > +	.atomic_commit		 = drm_atomic_helper_commit,
> > +};
> > +
> > +static struct drm_mode_config_helper_funcs vs_mode_config_helpers = {
> > +	.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
> > +};
> > +
> > +void vs_mode_config_init(struct drm_device *dev) {
> > +	int ret;
> > +
> > +	ret = drmm_mode_config_init(dev);
> > +	if (ret)
> > +		return;
> > +
> > +	dev->mode_config.min_width  = 0;
> > +	dev->mode_config.min_height = 0;
> > +	dev->mode_config.max_width  = 4096;
> > +	dev->mode_config.max_height = 4096;
> > +
> > +	dev->mode_config.funcs = &vs_mode_config_funcs;
> > +	dev->mode_config.helper_private = &vs_mode_config_helpers; }
> > diff --git a/drivers/gpu/drm/verisilicon/vs_modeset.h
> > b/drivers/gpu/drm/verisilicon/vs_modeset.h
> > new file mode 100644
> > index 000000000000..bd04f81d2ad2
> > --- /dev/null
> > +++ b/drivers/gpu/drm/verisilicon/vs_modeset.h
> > @@ -0,0 +1,10 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +/*
> > + * Copyright (C) 2020 VeriSilicon Holdings Co., Ltd.
> > + */
> > +
> > +#ifndef __VS_MODESET_H__
> > +#define __VS_MODESET_H__
> > +
> > +void vs_mode_config_init(struct drm_device *dev); #endif /*
> > +__VS_FB_H__ */
> > --
> > 2.27.0
> >
> 
> --
> With best wishes
> Dmitry
Dmitry Baryshkov June 23, 2024, 8:52 p.m. UTC | #3
On Sun, Jun 23, 2024 at 07:17:01AM GMT, Keith Zhao wrote:
> Hi Dmitry:
> 
> > -----Original Message-----
> > From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Please drop such headers from your replies. A simple "On 1st of January
John Doe wrote" is more than enough.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/verisilicon/Makefile b/drivers/gpu/drm/verisilicon/Makefile
index 7da54b259940..536091f37378 100644
--- a/drivers/gpu/drm/verisilicon/Makefile
+++ b/drivers/gpu/drm/verisilicon/Makefile
@@ -1,5 +1,6 @@ 
 # SPDX-License-Identifier: GPL-2.0
 
-vs_drm-objs := vs_dc_hw.o
+vs_drm-objs := vs_dc_hw.o \
+		vs_modeset.o
 
 obj-$(CONFIG_DRM_VERISILICON_DC8200) += vs_drm.o
diff --git a/drivers/gpu/drm/verisilicon/vs_modeset.c b/drivers/gpu/drm/verisilicon/vs_modeset.c
new file mode 100644
index 000000000000..c71fe0d32504
--- /dev/null
+++ b/drivers/gpu/drm/verisilicon/vs_modeset.c
@@ -0,0 +1,36 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2023 VeriSilicon Holdings Co., Ltd.
+ */
+#include <drm/drm_damage_helper.h>
+#include <drm/drm_fb_helper.h>
+#include <drm/drm_gem_framebuffer_helper.h>
+
+#include "vs_modeset.h"
+
+static const struct drm_mode_config_funcs vs_mode_config_funcs = {
+	.fb_create			 = drm_gem_fb_create,
+	.atomic_check		 = drm_atomic_helper_check,
+	.atomic_commit		 = drm_atomic_helper_commit,
+};
+
+static struct drm_mode_config_helper_funcs vs_mode_config_helpers = {
+	.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
+};
+
+void vs_mode_config_init(struct drm_device *dev)
+{
+	int ret;
+
+	ret = drmm_mode_config_init(dev);
+	if (ret)
+		return;
+
+	dev->mode_config.min_width  = 0;
+	dev->mode_config.min_height = 0;
+	dev->mode_config.max_width  = 4096;
+	dev->mode_config.max_height = 4096;
+
+	dev->mode_config.funcs = &vs_mode_config_funcs;
+	dev->mode_config.helper_private = &vs_mode_config_helpers;
+}
diff --git a/drivers/gpu/drm/verisilicon/vs_modeset.h b/drivers/gpu/drm/verisilicon/vs_modeset.h
new file mode 100644
index 000000000000..bd04f81d2ad2
--- /dev/null
+++ b/drivers/gpu/drm/verisilicon/vs_modeset.h
@@ -0,0 +1,10 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 VeriSilicon Holdings Co., Ltd.
+ */
+
+#ifndef __VS_MODESET_H__
+#define __VS_MODESET_H__
+
+void vs_mode_config_init(struct drm_device *dev);
+#endif /* __VS_FB_H__ */