Received: by 10.223.176.46 with SMTP id f43csp4702868wra; Tue, 23 Jan 2018 13:15:51 -0800 (PST) X-Google-Smtp-Source: AH8x2247AaXN0ItL73vMn+e81RUckMN86nxCf15So2aLHVcCI8e4SabvxbW43qjElF5zwZQnE6l3 X-Received: by 10.107.180.207 with SMTP id d198mr5758081iof.187.1516742151746; Tue, 23 Jan 2018 13:15:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516742151; cv=none; d=google.com; s=arc-20160816; b=UasVdhXefixPniV7GpuXZ6PH61Akl+RpBh8UQQ5mSxgxW9Q6kd3kb+fGruqoy1ZBnk Jcna2IzfkOBiQSlun/MpDYxmBtJ1b+NuhZEwQ6X7hCky9asNnQoBzGc142p/r9aY7ZD/ 7ySUo5ZB8T9bmh5fvmPhMZpC0RsP4Zidh23sON6esUTU12Atk95G6ks+MxMg2gIJVXjS Iau/JQj5rUQlFJfuoJ1b0YDKPII/JYV/rw+Ntm7niU3eN2v5ALge3Pu74YDWhjkZBjOK cA3aklSwxkS2G6V9ZOE28jH+4rApECPat4esGLZn1FYxHfIA4e/RnMPgWf8zLH/Ovoml 92bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=cfB0GyPKDRmerqE/8RZ7a+YfVXWP86dZr9QO/o4bWH8=; b=K4r8G95QiivlmxpHAcm58gfSNWVFQKtOt+1umQS7P2t8hRMszKkjUR1gPN0ZQ9AwgI ORitdoyCuSDnfUFY17QO9N9Qjz6pRo0HNbOZawM0g6BPbqjVA72b6+xUHMqBHI2vMpSU zLQpWciiXyjemTjpHSt/73J5euBOyfeSF2rl9n1qc163cLf3u+C9jCdjjiGrP04a2LXw PZafHQJdDvnfZNPtnYixUvpbGV/+EqOCLj+NeM26pUvHUYxPiVBOE+UyeeNUZUv2zkPN WgYMKszTEwK7ZLeySuJ1AMbTeYDGiqPvpLRhBB+ylhl5n/N5LeZeR1hO+3SwnMC5rCsq Eoog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=je4qKtiq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f67si16667425iod.76.2018.01.23.13.15.37; Tue, 23 Jan 2018 13:15:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=je4qKtiq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752592AbeAWVPP (ORCPT + 99 others); Tue, 23 Jan 2018 16:15:15 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:42709 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752234AbeAWVPN (ORCPT ); Tue, 23 Jan 2018 16:15:13 -0500 Received: by mail-pf0-f196.google.com with SMTP id b25so1302593pfd.9 for ; Tue, 23 Jan 2018 13:15:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=cfB0GyPKDRmerqE/8RZ7a+YfVXWP86dZr9QO/o4bWH8=; b=je4qKtiq6AovB1OYOSQjVYxbNg2b0agk5jpklFFw0YHr5mMWaWL1IB90oVVr5PgsKI 3VfzlY6h5VqTk66QlVh9KZbzUgtIRdTxtch4nEqKWsAZHdPwZevIADLoC0IGb2sHXOGV 3NZKMjvZEtuNuaoeq6Imo1hkeaL2xySnlExKs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=cfB0GyPKDRmerqE/8RZ7a+YfVXWP86dZr9QO/o4bWH8=; b=dUES25GbNuW46y5BwvsfRyWAnXagjRyqKGD4NCElZKC8RngR2zEni51L7UJdK1ILsm PwwrAjfj7iCLZkl4Lmantp6GRlhXRc5WY6fdXJ5PYAsuYZQf2zjfcUACZySwFiTu3IOn +OluN9Z86LOeiGyzu2LPqVmf3KHPSL22YKs+HwRsztvAlbX5QbkrpFTbqTaOwt6aHONJ IFI8i54cDz9FX26EHJMO9+f7W8hKiSLLjMTeHb+o2qd4ec3Wk05OUHKMCp3KoX7xdpUW ZMBOA9c3A/9bY43LQRf6X5vcPT1Z7gt4JhZuuEwyx9xIO5lNxfs3oxjRA1u4+Y8h0LS+ vp+Q== X-Gm-Message-State: AKwxytd/V3pUb4gt900KNnhwp58sQbouA5/clXq/ctK7Bkhlapj0gE/N mQ8opx0Vor8aWrvmSe9W4fzbjw== X-Received: by 10.99.161.26 with SMTP id b26mr226585pgf.322.1516742113262; Tue, 23 Jan 2018 13:15:13 -0800 (PST) Received: from ban.mtv.corp.google.com ([172.22.113.17]) by smtp.gmail.com with ESMTPSA id v25sm6221423pfg.132.2018.01.23.13.15.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jan 2018 13:15:12 -0800 (PST) Date: Tue, 23 Jan 2018 13:15:10 -0800 From: Brian Norris To: Philippe CORNU Cc: Archit Taneja , Andrzej Hajda , Laurent Pinchart , David Airlie , Yannick FERTRE , Vincent ABRIOU , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , Sean Paul , Nickey Yang , "hl@rock-chips.com" , "linux-rockchip@lists.infradead.org" , "mka@chromium.org" , "hoegsberg@gmail.com" , "zyw@rock-chips.com" , "xbl@rock-chips.com" Subject: Re: [PATCH] drm/bridge/synopsys: dsi: use common mipi_dsi_create_packet() Message-ID: <20180123211505.xvpu3putjjbqnl2b@ban.mtv.corp.google.com> References: <20180106003813.4816-1-briannorris@chromium.org> <715bb58c-efa6-7944-f186-c186d7fae569@st.com> <20180109185512.GA73309@google.com> <023c159e-0a7f-7d1b-a2d8-8ef19033a1b3@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <023c159e-0a7f-7d1b-a2d8-8ef19033a1b3@st.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Philippe, On Thu, Jan 18, 2018 at 11:40:48AM +0000, Philippe CORNU wrote: > On 01/11/2018 12:16 PM, Philippe CORNU wrote: > > To be honest, I do not really like the memcpy here too and I agree with > > you regarding the BE issue. > > > > My first "stm" driver (ie. before using this "freescale/rockchip" > > dw-mipi-dsi driver with the memcpy) used the "exact" same code as the > > Tegra dsi tegra_dsi_writesl() function with the 2 loops. > > > > https://elixir.free-electrons.com/linux/v4.14/source/drivers/gpu/drm/tegra/dsi.c#L1248 > > > > > > IMHO, it is better than memcpy... > > I added these 3 "documentation" lines, maybe we may reuse them or > > something similar... > > > > /* > > ?* Write 8-bit payload data into the 32-bit payload data register. > > ?* ex: payload data "0x01, 0x02, 0x03, 0x04, 0x05, 0x06" will become > > ?* "0x04030201 0x00000605" 32-bit writes > > ?*/ > > > > Not sure it helps to fix the BE issue but we may add a TODO stating that > > "this loop has not been tested on BE"... > > > > What is your opinion? I'm sorry, I don't think I noticed your reply here. I'm trying to unbury some email, but that's sometimes a losing battle... That code actually does look correct, and it's perhaps marginally better-looking in my opinion. It's up to you if you want to propose another patch :) At this point, it's only a matter of nice code, not correctness I believe. > As your patch has been merged, I have few short questions and for each > related new patch, I would like to know if you prefer that I implement > it or if you prefer to do it by yourself, it's really like you want, on > my side, no problem to make them all, some or none, I don't want us to > implement these in parallel :-) > > * Do you have any opinion regarding Tegra-like loops vs the memcpy? (see > my comment above) If you think the Tegra-like loops is a better approach > than memcpy, there is a small patch to write. My opinion is above. > * Returned value with number of bytes received/transferred: there is a > small patch to write I don't think I followed that one very well. I'm not sure my opinion really matters, as long as you get someone else to agree. I do not plan to write any such patch in the near term. > * Regarding read operations: I propose to add a TODO + DRM_WARN in case > someone want to use the API for read operations. Note that I plan to > implement the read feature but I do not know yet when and maybe Rockchip > people already have something ~ready? The warning would be nice to do now, regardless. Rockchip folks wrote up something for read support here [1], but it's based on a semi-forked version of the driver (we're trying to clean up the divergence, but it's not there yet). Perhaps it would provide useful fodder for your work. I don't think Rockchip is immediately working on upstreaming this particular patch, so it's totally fair to handle it yourself. It's got the GPL sign-off ;) Brian [1] https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/863347