From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAFC4C4741F for ; Mon, 9 Nov 2020 09:32:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B97E206ED for ; Mon, 9 Nov 2020 09:32:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ZT/OyyJY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725854AbgKIJcv (ORCPT ); Mon, 9 Nov 2020 04:32:51 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:40088 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726176AbgKIJcv (ORCPT ); Mon, 9 Nov 2020 04:32:51 -0500 Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BC446B2B; Mon, 9 Nov 2020 10:32:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1604914368; bh=QZM8pWa3XxAYZ/jFdcXufIqaoC5vUkVqklUwQthkAY0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZT/OyyJYYoo+ftRVZuQcbYex0j660Q0YDT8LJj+92QfV64CitInRH7PbVbvzqBS2d lY56r0xnldU+eXHVQDLkxeJCjTEGyxk79c8koDKCL7hUJPv/jHg2yOsLW6P+6tPpJ1 E5e0jWuS6ow2Tkz34MlwfZxBE3aWNWG2ZuzL6XFo= Date: Mon, 9 Nov 2020 11:32:45 +0200 From: Laurent Pinchart To: Tomi Valkeinen Cc: Sebastian Reichel , Nikhil Devshatwar , linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org, Sekhar Nori , Tony Lindgren , "H . Nikolaus Schaller" , Sebastian Reichel Subject: Re: [PATCH v3 26/56] drm/omap: dsi: drop custom enable_te() API Message-ID: <20201109093245.GW6029@pendragon.ideasonboard.com> References: <20201105120333.947408-1-tomi.valkeinen@ti.com> <20201105120333.947408-27-tomi.valkeinen@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201105120333.947408-27-tomi.valkeinen@ti.com> Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Hi Tomi and Sebastian, Thank you for the patch. On Thu, Nov 05, 2020 at 02:03:03PM +0200, Tomi Valkeinen wrote: > From: Sebastian Reichel > > Instead of using the custon enable_te() API, this automatically s/custon/custom/ > enables/disables TE core support when a matching packet is send s/send/sent/ > to the panel. > > Signed-off-by: Sebastian Reichel > Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart > --- > .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 3 -- > drivers/gpu/drm/omapdrm/dss/dsi.c | 34 ++++++++++++++----- > drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 -- > 3 files changed, 25 insertions(+), 14 deletions(-) > > diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c > index 43f63b5a120b..dc2c045cc6b0 100644 > --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c > +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c > @@ -772,7 +772,6 @@ static int dsicm_update(struct omap_dss_device *dssdev, > > static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) > { > - struct omap_dss_device *src = ddata->src; > struct mipi_dsi_device *dsi = ddata->dsi; > int r; > > @@ -781,8 +780,6 @@ static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) > else > r = mipi_dsi_dcs_set_tear_off(dsi); > > - src->ops->dsi.enable_te(src, enable); > - > /* possible panel bug */ > msleep(100); > > diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c > index 921e7a1e1014..41431ca34568 100644 > --- a/drivers/gpu/drm/omapdrm/dss/dsi.c > +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c > @@ -4110,10 +4110,8 @@ static void dsi_display_disable(struct omap_dss_device *dssdev, > mutex_unlock(&dsi->lock); > } > > -static int dsi_enable_te(struct omap_dss_device *dssdev, bool enable) > +static int dsi_enable_te(struct dsi_data *dsi, bool enable) > { > - struct dsi_data *dsi = to_dsi_data(dssdev); > - > dsi->te_enabled = enable; > > if (dsi->te_gpio) { > @@ -4723,6 +4721,7 @@ static ssize_t omap_dsi_host_transfer(struct mipi_dsi_host *host, > { > struct dsi_data *dsi = host_to_omap(host); > struct omap_dss_device *dssdev = &dsi->output; > + int r; > > if (!!(msg->flags & MIPI_DSI_MSG_USE_LPM) != dsi->in_lp_mode) { > dsi_vc_enable_hs(dssdev, msg->channel, > @@ -4739,16 +4738,35 @@ static ssize_t omap_dsi_host_transfer(struct mipi_dsi_host *host, > case MIPI_DSI_DCS_LONG_WRITE: > case MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE: > case MIPI_DSI_NULL_PACKET: > - return dsi_vc_write_common(dssdev, msg); > + r = dsi_vc_write_common(dssdev, msg); > + break; > case MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM: > case MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM: > case MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM: > - return dsi_vc_generic_read(dssdev, msg); > + r = dsi_vc_generic_read(dssdev, msg); > + break; > case MIPI_DSI_DCS_READ: > - return dsi_vc_dcs_read(dssdev, msg); > + r = dsi_vc_dcs_read(dssdev, msg); > + break; > + default: > + r = -EINVAL; > + break; > } > > - return -EINVAL; > + if (r < 0) > + return r; > + > + if (msg->type == MIPI_DSI_DCS_SHORT_WRITE || > + msg->type == MIPI_DSI_DCS_SHORT_WRITE_PARAM) { > + u8 cmd = ((u8 *)msg->tx_buf)[0]; > + > + if (cmd == MIPI_DCS_SET_TEAR_OFF) > + dsi_enable_te(dsi, false); > + else if (cmd == MIPI_DCS_SET_TEAR_ON) > + dsi_enable_te(dsi, true); > + } > + > + return 0; > } > > static int dsi_get_clocks(struct dsi_data *dsi) > @@ -4795,8 +4813,6 @@ static const struct omap_dss_device_ops dsi_ops = { > .disable_video_output = dsi_disable_video_output, > > .update = dsi_update, > - > - .enable_te = dsi_enable_te, > }, > }; > > diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h > index 2d44a8e32fcc..1520a5f752b7 100644 > --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h > +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h > @@ -288,8 +288,6 @@ struct omapdss_dsi_ops { > int (*set_config)(struct omap_dss_device *dssdev, > const struct omap_dss_dsi_config *cfg); > > - int (*enable_te)(struct omap_dss_device *dssdev, bool enable); > - > int (*update)(struct omap_dss_device *dssdev, int channel, > void (*callback)(int, void *), void *data); > -- Regards, Laurent Pinchart