From patchwork Tue May 5 16:03:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11529577 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A64D1139A for ; Tue, 5 May 2020 16:06:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8491E206A4 for ; Tue, 5 May 2020 16:06:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C6WOu57G" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8491E206A4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 811496E28A; Tue, 5 May 2020 16:05:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1A0A96E28A for ; Tue, 5 May 2020 16:05:57 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id z8so2481974wrw.3 for ; Tue, 05 May 2020 09:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=O1oAMhDPXg9F06mOnyk1XlMx/B4VkAxgxCrayfwc8CY=; b=C6WOu57GPpVg+TQWaH4qoiLJNdx4F5WNr/0puTjrDx95SC1HPGf+p3nbCzEJ2m6lRf rgYhkV9fEzZdk4mCY8A4x5lO96sdikaGO8ozJUUKORyfOqSWJ2zxJbrE7fM/oDnRjTu3 +ncBCZWgM9bvE2kGIE3o0PObv8PbSFd8Cgb9nmdSjbA/HUwhcSHKr4IHLw8veu1FrSEe K6Cvhwbb2YvEKHLrHGn3nS7u6WPhhUHLd9uxaUEE70Tzd0T2XAUT6SWTCVTfWThJRW04 yFzImUqSnP/eF6tlcKbEZmOMtmrS+LOBLeKWfoD3s0r320n/nG2n/x1U68zum5SE6NUg 1ToA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=O1oAMhDPXg9F06mOnyk1XlMx/B4VkAxgxCrayfwc8CY=; b=q3RpzRNORW45Em4q9HxjOkLA6K6HGsBgeLhqL+ARp1U9lhYvd0VNqTHpopqi6i/syx Kk9JTL5n82nZstMQl8QbPydLlBPosQ1d0xTqK0t/A8tQ7U7t4e/LPNgzCTd0GSew9QoB cZcSxwdmbPqnwNtaibRdOuZCAv+p8pFZnTRqwVbbobcjIlcHtzuRjPa4Z+Hb68D3pxzs rkgjW0ZJbZDW16OjVJwxpHLTg6AHL+3QPqFaY8uuYboLGVczRA831jMaLdEMACbqmuMW BnGWPtlBucBxFvE3r0kqMPHqF7cf1D8Gdju2QH9nb95FduIkWe2G1TxlQ3nCVOMMExTA 3zmg== X-Gm-Message-State: AGi0PubWBpBppm1xZ8mylQrFliNT73m+gf/RO0D4aHIF5vOn4Xe3Xow7 AGbqlIDPpxXHypf+aqbgEEDg6Em2 X-Google-Smtp-Source: APiQypLTvjHMny0zNDh50iVzS9QS/FuVOFmDIQULuxjMPePp4S8brD5g0u/cPbhDtz1bOyQ3rnPnrQ== X-Received: by 2002:adf:aa8e:: with SMTP id h14mr4865528wrc.371.1588694755425; Tue, 05 May 2020 09:05:55 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id w18sm3803621wrn.55.2020.05.05.09.05.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2020 09:05:54 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm/dsi: use stack buffer in mipi_dsi_dcs_write() Date: Tue, 5 May 2020 17:03:27 +0100 Message-Id: <20200505160329.2976059-1-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jani Nikula , Thierry Reding , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Currently the function heap allocates when we have any payload. Where in many case the payload is 1 byte - ouch. From casual observation, vast majority of the payloads are smaller than 8 bytes - so use a stack array tx[8] to avoid the senseless kmalloc and kfree dance. Cc: Jani Nikula Cc: Thierry Reding Signed-off-by: Emil Velikov Reviewed-by: Thierry Reding --- drivers/gpu/drm/drm_mipi_dsi.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 55531895dde6..b96d5b4629d7 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -748,26 +748,26 @@ ssize_t mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, u8 cmd, { ssize_t err; size_t size; + u8 stack_tx[8]; u8 *tx; - if (len > 0) { - size = 1 + len; - + size = 1 + len; + if (len > ARRAY_SIZE(stack_tx) - 1) { tx = kmalloc(size, GFP_KERNEL); if (!tx) return -ENOMEM; - - /* concatenate the DCS command byte and the payload */ - tx[0] = cmd; - memcpy(&tx[1], data, len); } else { - tx = &cmd; - size = 1; + tx = stack_tx; } + /* concatenate the DCS command byte and the payload */ + tx[0] = cmd; + if (data) + memcpy(&tx[1], data, len); + err = mipi_dsi_dcs_write_buffer(dsi, tx, size); - if (len > 0) + if (tx != stack_tx) kfree(tx); return err; From patchwork Tue May 5 16:03:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11529579 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D3506139A for ; Tue, 5 May 2020 16:06:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B1EAC215A4 for ; Tue, 5 May 2020 16:06:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="b/k210BO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1EAC215A4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 267B76E5D5; Tue, 5 May 2020 16:06:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id C98F36E5D5 for ; Tue, 5 May 2020 16:05:58 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id u16so2942403wmc.5 for ; Tue, 05 May 2020 09:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NqEhgBSEIG5151Cz1riIO0qRUDYSNMWuz+uU1QjW4mY=; b=b/k210BOpW/+tpzzKPNalFR/g8GmfZJi7pIHUEf2OdV6zJv7ObRY6lQUfwFU2OHtxb xYamKSdsQVGQmgS99iY7wf8mSkbzVusnIpjSRbV6tvkZWls4z4gNHKX4pgU5D1eNFDiS SVs+I8nuNxf3e120yK1ezUcXLaF6T8898jVTXhfK7PRvl9z9DvIFF3G2e+r+xyiwib4S SfsjIkX2yiFqp4Sq97ET0rI3x20icz0KhUdSiWCxvpqlH5BLHmo8UwDIJi1+8LtY1fbF 13t0wU/TaAYocmNZEDZp0VoRZzlEZWVBAjcAZn5axgHjWqO4i/UsBtnYE0/+G3ssfE+S Te7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NqEhgBSEIG5151Cz1riIO0qRUDYSNMWuz+uU1QjW4mY=; b=PDd2ziBPTHvgTyuf1+yptkGbOUOwHn9W+NXTqGJLv+42uMVO96wHy94g0zKXlLqMNE aZdX5Dtgoc2ze89HwFsG/zIpKFDzWMBio2rUv9QG3yeB2KPlmCTT3G4vFGK0F0usaeBt /kAQiBEBzat1LC31asz2ZF8uUhZy3fMzHJL/93aCyK9xpnAfwGRIK4trUzCLXMjzOopt oLAwrCutWAOjQZBtbaDhloBymqQ00tpbptjwv3iZlHN4nKCsbRVE8//CWZz4LRA0NGDQ JBMj4qI6EyyDmtd2z6kv+MWLU4tcWgJqqaKM0o4eHWaJRCTDC8Gbr1MMiDR9iySbdxCb lT1g== X-Gm-Message-State: AGi0PuaXjLxmnZ8wCLByAPmpRhPFKXjpFqfZJAftYae7duCjOQLOX72Q SVhIxh/ZdNsBe+w3N+s0ZnSzJN9I X-Google-Smtp-Source: APiQypLGpLhwzV8Ipd2UEkkuyAU6Sl8bNdSrXv9O3nTa44t5RsgNj0lHvLnsbQ4sUsP0RsxGVCDiHw== X-Received: by 2002:a05:600c:218e:: with SMTP id e14mr4550930wme.140.1588694757138; Tue, 05 May 2020 09:05:57 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id w18sm3803621wrn.55.2020.05.05.09.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2020 09:05:56 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm/panel: use mipi_dsi_dcs_write_buffer where possible Date: Tue, 5 May 2020 17:03:28 +0100 Message-Id: <20200505160329.2976059-2-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200505160329.2976059-1-emil.l.velikov@gmail.com> References: <20200505160329.2976059-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , Thierry Reding , emil.l.velikov@gmail.com, Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov A few of the new panels create a local macro wrapping around mipi_dsi_dcs_write. At the same time, they don't really care about the command/payload split. mipi_dsi_dcs_write does a kmalloc/memcpy/kfree for payload > 7 bytes. kmalloc - avoid that all together by using the _buffer function. Aside: panel-xinpeng-xpp055c272.c calls its wrapper "generic" although it should be "dcs". But that for another day/patch. Cc: Heiko Stuebner Cc: Heiko Stuebner Cc: Thierry Reding Cc: Sam Ravnborg Signed-off-by: Emil Velikov --- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 4 ++-- drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 4 ++-- drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-elida-kd35t133.c b/drivers/gpu/drm/panel/panel-elida-kd35t133.c index 711ded453c44..00e3d67af812 100644 --- a/drivers/gpu/drm/panel/panel-elida-kd35t133.c +++ b/drivers/gpu/drm/panel/panel-elida-kd35t133.c @@ -52,9 +52,9 @@ static inline struct kd35t133 *panel_to_kd35t133(struct drm_panel *panel) } #define dsi_dcs_write_seq(dsi, cmd, seq...) do { \ - static const u8 d[] = { seq }; \ + static const u8 b[] = { cmd, seq }; \ int ret; \ - ret = mipi_dsi_dcs_write(dsi, cmd, d, ARRAY_SIZE(d)); \ + ret = mipi_dsi_dcs_write_buffer(dsi, b, ARRAY_SIZE(b)); \ if (ret < 0) \ return ret; \ } while (0) diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c index 5a7a31c8513e..eaa9da3ebbea 100644 --- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c @@ -246,9 +246,9 @@ struct ltk050h3146w *panel_to_ltk050h3146w(struct drm_panel *panel) } #define dsi_dcs_write_seq(dsi, cmd, seq...) do { \ - static const u8 d[] = { seq }; \ + static const u8 b[] = { cmd, seq }; \ int ret; \ - ret = mipi_dsi_dcs_write(dsi, cmd, d, ARRAY_SIZE(d)); \ + ret = mipi_dsi_dcs_write_buffer(dsi, b, ARRAY_SIZE(b)); \ if (ret < 0) \ return ret; \ } while (0) diff --git a/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c b/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c index 1645aceab597..9e07d7e86807 100644 --- a/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c +++ b/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c @@ -62,9 +62,9 @@ static inline struct xpp055c272 *panel_to_xpp055c272(struct drm_panel *panel) } #define dsi_generic_write_seq(dsi, cmd, seq...) do { \ - static const u8 d[] = { seq }; \ + static const u8 b[] = { cmd, seq }; \ int ret; \ - ret = mipi_dsi_dcs_write(dsi, cmd, d, ARRAY_SIZE(d)); \ + ret = mipi_dsi_dcs_write_buffer(dsi, b, ARRAY_SIZE(b)); \ if (ret < 0) \ return ret; \ } while (0) From patchwork Tue May 5 16:03:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11529581 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4291D1392 for ; Tue, 5 May 2020 16:06:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2057D206A4 for ; Tue, 5 May 2020 16:06:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JaWXAoJk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2057D206A4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A73DB6E7DB; Tue, 5 May 2020 16:06:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id D918A6E5D5 for ; Tue, 5 May 2020 16:05:59 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id u16so2942458wmc.5 for ; Tue, 05 May 2020 09:05:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9Lg+gPF2P0MEgQL05rDAB/dXUVq400Yz6N4qXpQCO5A=; b=JaWXAoJklRiuF6MmIYIEcwbZXJDKW70vF6webo/ITMZsjhUqm7mJ088PRDxFkBMZ3y Hcqos8s0cCR+TD1Y/rj3q5vZRzw8B3e9208JOfeRKTWlPuXBzcZasoFgRCRcqERw39PC DiT9iJwBUU91azVyqJi+QNpCvexIMwQIXbnqQ6qWoS4RgJSoHX0BpREqoAY6zl0XOf9P TsywwlOlanP9r0nJJjvxXEYiN8Zh6qwhvmDkJEBhsJV7QWbPT+GqJZ1HIPu21tMrbHqu H+U/t72+8yJC+kzt3nJlOujhLNi/olkLLmQBugciQtZFU9TbkCiIMcMc6eIoZTrqR+ql YgZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9Lg+gPF2P0MEgQL05rDAB/dXUVq400Yz6N4qXpQCO5A=; b=dJDBpjWabzb4mXnhKv28GTOyeIPdo0sDyYMpkr59etx4mavqXlJbmgvQHzbzlNReSL kx/5h2mAIsJb6ZaKUilzh9+itMa4VTznY6RU+JEsuSBS589T58jN8mxY/362qeIQZK86 Q9l6BNDQPbFbcGF46/PtuT7sBJCf9qbW5SfbKi/okjMdiZXI/YMkz8h+VueaqiOD9sxn VawEBtkYy2GpgCiB/r4CInJNPvlrvDzJpPnsomOo/xd/5uLnolYej0d/gp4YWmLbL/C2 J+Ge/EHqzA8D1lGDH1d/PZvx7k55aGV267eWPlXcEvPi/Wu6R2GWDnLoYAJSY78xfmNz ZSew== X-Gm-Message-State: AGi0PuZHHz35vFiz9qTSCY7nd1byP66b2hxJbz5LaaZgU1cm3DBJ9nXB iG2ZRWY2xFZyLsXCTL4Yc42zd/XX X-Google-Smtp-Source: APiQypJ7UwzrgmnXlJhm0jvdrh9RmtJzGL3bWRqKRdVT29OlrJgJA3xb8VTYnHYpSOuST12xPz25Vg== X-Received: by 2002:a1c:80c3:: with SMTP id b186mr4404910wmd.117.1588694758238; Tue, 05 May 2020 09:05:58 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id w18sm3803621wrn.55.2020.05.05.09.05.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2020 09:05:57 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/3] drm/mipi: use dcs write for mipi_dsi_dcs_set_tear_scanline Date: Tue, 5 May 2020 17:03:29 +0100 Message-Id: <20200505160329.2976059-3-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200505160329.2976059-1-emil.l.velikov@gmail.com> References: <20200505160329.2976059-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robert Chiras , Vinay Simha BN , Jani Nikula , Thierry Reding , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov The helper uses the MIPI_DCS_SET_TEAR_SCANLINE, although it's currently using the generic write. This does not look right. Perhaps some platforms don't distinguish between the two writers? Cc: Robert Chiras Cc: Vinay Simha BN Cc: Jani Nikula Cc: Thierry Reding Fixes: e83950816367 ("drm/dsi: Implement set tear scanline") Signed-off-by: Emil Velikov Reviewed-by: Thierry Reding --- Robert, can you please test this against the only user - the Raydium RM67191 panel driver that you introduced. Thanks Vinay, can you confirm if this is a genuine typo or there's something really subtle happening. --- drivers/gpu/drm/drm_mipi_dsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index b96d5b4629d7..07102d8da58f 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -1082,11 +1082,11 @@ EXPORT_SYMBOL(mipi_dsi_dcs_set_pixel_format); */ int mipi_dsi_dcs_set_tear_scanline(struct mipi_dsi_device *dsi, u16 scanline) { - u8 payload[3] = { MIPI_DCS_SET_TEAR_SCANLINE, scanline >> 8, - scanline & 0xff }; + u8 payload[2] = { scanline >> 8, scanline & 0xff }; ssize_t err; - err = mipi_dsi_generic_write(dsi, payload, sizeof(payload)); + err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_TEAR_SCANLINE, payload, + sizeof(payload)); if (err < 0) return err;