From: Jani Nikula <jani.nikula@linux.intel.com>
To: Tejas Vipin <tejasvipin76@gmail.com>,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de
Cc: dianders@chromium.org, airlied@gmail.com, daniel@ffwll.ch,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Tejas Vipin <tejasvipin76@gmail.com>
Subject: Re: [PATCH 2/2] drm/mipi-dsi: Change multi functions to use quiet member of mipi_dsi_multi_context
Date: Wed, 24 Jul 2024 18:32:14 +0300 [thread overview]
Message-ID: <877cdakdq9.fsf@intel.com> (raw)
In-Reply-To: <20240724122447.284165-3-tejasvipin76@gmail.com>
On Wed, 24 Jul 2024, Tejas Vipin <tejasvipin76@gmail.com> wrote:
> Changes all the multi functions to check if the current context requires
> errors to be printed or not using the quiet member.
>
> Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com>
> ---
> drivers/gpu/drm/drm_mipi_dsi.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
> index a471c46f5ca6..cbb77342d201 100644
> --- a/drivers/gpu/drm/drm_mipi_dsi.c
> +++ b/drivers/gpu/drm/drm_mipi_dsi.c
> @@ -814,6 +814,8 @@ void mipi_dsi_generic_write_multi(struct mipi_dsi_multi_context *ctx,
> ret = mipi_dsi_generic_write(dsi, payload, size);
> if (ret < 0) {
> ctx->accum_err = ret;
> + if (ctx->quiet)
> + return;
> dev_err(dev, "sending generic data %*ph failed: %d\n",
> (int)size, payload, ctx->accum_err);
A maintainability nitpick. Imagine someone wishing to add some more
error handling here. Or something else after the block.
IMO the dev_err() should be wrapped in if (!ctx->quiet) instead of
adding an early return.
Ditto everywhere.
BR,
Jani.
> }
> @@ -958,6 +960,8 @@ void mipi_dsi_dcs_write_buffer_multi(struct mipi_dsi_multi_context *ctx,
> ret = mipi_dsi_dcs_write_buffer(dsi, data, len);
> if (ret < 0) {
> ctx->accum_err = ret;
> + if (ctx->quiet)
> + return;
> dev_err(dev, "sending dcs data %*ph failed: %d\n",
> (int)len, data, ctx->accum_err);
> }
> @@ -1450,6 +1454,8 @@ void mipi_dsi_picture_parameter_set_multi(struct mipi_dsi_multi_context *ctx,
> ret = mipi_dsi_picture_parameter_set(dsi, pps);
> if (ret < 0) {
> ctx->accum_err = ret;
> + if (ctx->quiet)
> + return;
> dev_err(dev, "sending PPS failed: %d\n",
> ctx->accum_err);
> }
> @@ -1481,6 +1487,8 @@ void mipi_dsi_compression_mode_ext_multi(struct mipi_dsi_multi_context *ctx,
> ret = mipi_dsi_compression_mode_ext(dsi, enable, algo, pps_selector);
> if (ret < 0) {
> ctx->accum_err = ret;
> + if (ctx->quiet)
> + return;
> dev_err(dev, "sending COMPRESSION_MODE failed: %d\n",
> ctx->accum_err);
> }
> @@ -1506,6 +1514,8 @@ void mipi_dsi_dcs_nop_multi(struct mipi_dsi_multi_context *ctx)
> ret = mipi_dsi_dcs_nop(dsi);
> if (ret < 0) {
> ctx->accum_err = ret;
> + if (ctx->quiet)
> + return;
> dev_err(dev, "sending DCS NOP failed: %d\n",
> ctx->accum_err);
> }
> @@ -1531,6 +1541,8 @@ void mipi_dsi_dcs_enter_sleep_mode_multi(struct mipi_dsi_multi_context *ctx)
> ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
> if (ret < 0) {
> ctx->accum_err = ret;
> + if (ctx->quiet)
> + return;
> dev_err(dev, "sending DCS ENTER_SLEEP_MODE failed: %d\n",
> ctx->accum_err);
> }
> @@ -1556,6 +1568,8 @@ void mipi_dsi_dcs_exit_sleep_mode_multi(struct mipi_dsi_multi_context *ctx)
> ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
> if (ret < 0) {
> ctx->accum_err = ret;
> + if (ctx->quiet)
> + return;
> dev_err(dev, "sending DCS EXIT_SLEEP_MODE failed: %d\n",
> ctx->accum_err);
> }
> @@ -1581,6 +1595,8 @@ void mipi_dsi_dcs_set_display_off_multi(struct mipi_dsi_multi_context *ctx)
> ret = mipi_dsi_dcs_set_display_off(dsi);
> if (ret < 0) {
> ctx->accum_err = ret;
> + if (ctx->quiet)
> + return;
> dev_err(dev, "sending DCS SET_DISPLAY_OFF failed: %d\n",
> ctx->accum_err);
> }
> @@ -1606,6 +1622,8 @@ void mipi_dsi_dcs_set_display_on_multi(struct mipi_dsi_multi_context *ctx)
> ret = mipi_dsi_dcs_set_display_on(dsi);
> if (ret < 0) {
> ctx->accum_err = ret;
> + if (ctx->quiet)
> + return;
> dev_err(dev, "sending DCS SET_DISPLAY_ON failed: %d\n",
> ctx->accum_err);
> }
> @@ -1633,6 +1651,8 @@ void mipi_dsi_dcs_set_tear_on_multi(struct mipi_dsi_multi_context *ctx,
> ret = mipi_dsi_dcs_set_tear_on(dsi, mode);
> if (ret < 0) {
> ctx->accum_err = ret;
> + if (ctx->quiet)
> + return;
> dev_err(dev, "sending DCS SET_TEAR_ON failed: %d\n",
> ctx->accum_err);
> }
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-07-24 15:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 12:24 [PATCH 0/2] Allow errors to be silenced in multi functions Tejas Vipin
2024-07-24 12:24 ` [PATCH 1/2] drm/mipi-dsi: Add quiet member to mipi_dsi_multi_context struct Tejas Vipin
2024-07-24 15:28 ` Jani Nikula
2024-07-24 12:24 ` [PATCH 2/2] drm/mipi-dsi: Change multi functions to use quiet member of mipi_dsi_multi_context Tejas Vipin
2024-07-24 15:32 ` Jani Nikula [this message]
2024-07-25 8:28 ` Maxime Ripard
2024-07-25 17:12 ` Doug Anderson
2024-07-26 9:15 ` Maxime Ripard
2024-07-26 14:49 ` Doug Anderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877cdakdq9.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=tejasvipin76@gmail.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox