Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14016750ybl; Mon, 30 Dec 2019 02:25:42 -0800 (PST) X-Google-Smtp-Source: APXvYqwJs2y0KOSccD2AxJHJ71F7iC+8284/zoRAzzq/p4DZvhfSQ20UXccUHvSGox8pfNPFaHYT X-Received: by 2002:a9d:65da:: with SMTP id z26mr65378567oth.197.1577701542852; Mon, 30 Dec 2019 02:25:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577701542; cv=none; d=google.com; s=arc-20160816; b=MOQHffM9bhk7XMNJ/93sD125P7PuXSH9jpPLzVFe18ZkPURuZxGTYjHSWz4vZYNjn4 CjUvQljv7VRznFRd+wIUQ13Sik2eQa2g/bQmirQ86T27DrO5h98+s8IoGPub3Vvbcka1 JljYz75EktyNYFLiAXLbyPEQndIx9cjbY20ADlUaLhQ2u/x6bwUPURkCbF/aw9JNaZAT m4U5Xgak9F2o6d9IJewSTAOah1TajGmLc7R6HlitszoOV6FeljoGVu1ZGw93Ate0PEZ4 1DNVVDQQhsq/dYqW7NnlUOzLcEFspT4w3yt+i5Am11KCGgwa5yORFS7UMYbw6VMn/O1e lQgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rzDoRC4MHhm3h5pF1afVY20HHsvL3mkKYh/fXUPc0Uw=; b=nkuSl9gLbfXieTnO4+oGCDQw3Oa7Rsk13Q6dhDfdRxeOu60wKdfEFKN0wkpMayXsLA oqUnSiQmqUwCQvjuJZiN7ySBYVpzBGs5ILRnupEwDJpSVIvUpsCAK2zspJiIBX4iSEG7 nGwy/lIOVbzU8edI+yryS+BSqUk2uFDwaW2aS16GqR2mfcVmruiYp+I9cSuIInXuVSJx 2wEd1FtoQnae8mCom4AG5A+oxtfXi3aR2l/yF1cFLmxF15WQ0SFe+MEKYCW3E3Kmttd4 RM7XfP8pWpMY12uUBVLL+2ZkrTe9u/AYJylG7aHUakTt+VZ1e5Wzv/z2wvP1oI2OOinJ HmoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fooishbar-org.20150623.gappssmtp.com header.s=20150623 header.b=WtMjvql2; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r82si8126035oia.36.2019.12.30.02.25.30; Mon, 30 Dec 2019 02:25:42 -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=@fooishbar-org.20150623.gappssmtp.com header.s=20150623 header.b=WtMjvql2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727360AbfL3KYr (ORCPT + 99 others); Mon, 30 Dec 2019 05:24:47 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:34515 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727273AbfL3KYr (ORCPT ); Mon, 30 Dec 2019 05:24:47 -0500 Received: by mail-lf1-f66.google.com with SMTP id l18so16671517lfc.1 for ; Mon, 30 Dec 2019 02:24:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fooishbar-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rzDoRC4MHhm3h5pF1afVY20HHsvL3mkKYh/fXUPc0Uw=; b=WtMjvql2lt33WePTaTxAejV/6Ql6c3RMJxp4Y23AMXse9xix5gI1Q4NnDK5ae02N6m 4LtduhmLFWqoU6P/2rplRTaKlUsF0ikMpjkvKNNj2NKqjcX0mFsgf/ofOq+dh6zumofR ZzBhRH3AAJhP80OMBTcdN+h5hJzrTXMdhj76bVcdCdHGVeRdhtXrCGQfS/pEuYDHR4jq /UZxFPsGjWGR6EBmiKNn4GWLFNxlSxBsGz4FaHVb19XG9bwEaRsCmcJsMSALj1i6SiBP 5T6ZpJtH98PU82kKunQ7kzRF3LI8JlXeqm6uwYciDhqUYhqU2oh/NhQKCPLwEMvDxxZb 11qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rzDoRC4MHhm3h5pF1afVY20HHsvL3mkKYh/fXUPc0Uw=; b=iCgVAWCYfY9td7D8eZck+1fir34GL0M0xdFExM8rIVo+VllEp6m9y0avkR5cYAxxY8 ZeoEA8z4fMPhap3l2HTmK6DPv3DrmMpN/BNjHQtojMQgTZGia4peRp1mmGDYUnWHIG9o /7OuQdKGvKDMv5uYqKWt/WWFQTBgxpSbM6m4b7ZrWjRS8oQkbnAdjFyAKSIleHOjqidE laVQccnXu2uz4JDuJYcNIwTdUnxTwd34YQ9XOq3z5+esuCTCI0CyrSMk+XOyp8BXgBaa XI2nvgM2WAjaUKP+0WhOCxSkD+7/P1xWBzqCU/psylacTXcbGm7Z9aGV/ZfW2qMmGHKz 4fzA== X-Gm-Message-State: APjAAAW9Oxq/7nWNqerM514emr998GwDkULSy4gtgU5m645Twnl9NGDb 4XNvz8UAdwFSqQ48J66vfUOQ3lw57MT5V+TuWMxJZngT X-Received: by 2002:ac2:544f:: with SMTP id d15mr39891977lfn.126.1577701485459; Mon, 30 Dec 2019 02:24:45 -0800 (PST) MIME-Version: 1.0 References: <1577495680-28766-1-git-send-email-tiantao6@hisilicon.com> In-Reply-To: <1577495680-28766-1-git-send-email-tiantao6@hisilicon.com> From: Daniel Stone Date: Mon, 30 Dec 2019 10:23:40 +0000 Message-ID: Subject: Re: [PATCH] drm/hisilicon: Added three new resolutions and changed the alignment to 128 Bytes To: Tian Tao Cc: Chen Feng , David Airlie , Daniel Vetter , tzimmermann@suse.de, Gerd Hoffmann , Alex Deucher , tglx@linutronix.de, dri-devel , Xinliang Liu , Linux Kernel Mailing List , linuxarm@huawei.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tian, On Sat, 28 Dec 2019 at 01:14, Tian Tao wrote: > @@ -118,11 +119,9 @@ static void hibmc_plane_atomic_update(struct drm_plane *plane, > writel(gpu_addr, priv->mmio + HIBMC_CRT_FB_ADDRESS); > > reg = state->fb->width * (state->fb->format->cpp[0]); > - /* now line_pad is 16 */ > - reg = PADDING(16, reg); > > line_l = state->fb->width * state->fb->format->cpp[0]; > - line_l = PADDING(16, line_l); > + line_l = PADDING(128, line_l); The 'line length' here is the 'stride' field of the FB. Stride is set by userspace when allocating the buffer, and the kernel must not attempt to guess what userspace set. You should use state->fb->strides[0] directly here, and in your atomic_check() function, make sure that the framebuffer stride is correctly aligned. Please split this into a separate change. Your commit has three changes in it, which should all be separate commits: * enforce 128-byte stride alignment (is this a hardware limit?) * get the BO from drm_fb rather than hibmc_fb (can hibmc_fb->obj just be removed now?) * add new clock/resolution configurations Cheers, Daniel