Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp507980ybl; Wed, 8 Jan 2020 00:49:41 -0800 (PST) X-Google-Smtp-Source: APXvYqyUPWMGeMzbZyseym/QnNtiDR/Z9ZZKi57CkbAT7Vdkoyn2EB3K7T6Sm3Jewl3hDbkUM462 X-Received: by 2002:aca:ec4f:: with SMTP id k76mr2120885oih.156.1578473381146; Wed, 08 Jan 2020 00:49:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578473381; cv=none; d=google.com; s=arc-20160816; b=mE5hWFRFdUD0iNHsvDEl1KBS88Igv4rWaREk4UO0MZAo0T4xv33XzCEBfkz4etfvZl fxzwJaWK1Mv08iEuLOHdSBYxltzwP6I4CBGWH9ychQ95cTpcI3eTpFcjeKTgRZp6bwnX 4XzuAPP4XhG3j4Zyik/iOdN2ZZxb7zdJSMdJSAFlERyIbBeuQ0JBhjo0F+EGuVpHreyp 13/fzdkDGlY36lFYLDsdhCrQ97wfAJ3/i7dAXKbT7j+17xLKNZ4mhFef3SGyusPD7NaY xZ/bWWUH2o/nVjJxvYxwYcxGGGUqqp8xaY18JSmNDG8fYlKJ052QXHinrndGGkDLVJY4 WAWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject; bh=08vp9oCQXh7Tz3qJlQFWeNhCGo3Ew2aEvnQm/1M1Txw=; b=ezzs3xSgI/afyox/MoQwWOTA8wxLAjFANOJ4qZbr8aiQUXjV3lvIjYkzYDiwnf5GXB QfFyHMyxtMaHVYDK4Vu8FRvLXEpzJgCw3WR0FIxmz7RpV+xIFfYWiKkXVOaq2Zlfc4jP UUsYQxDSNK3SHeKO9MCdH76ZaVA8pjm4U2YKUiQ83terSx7iPQXnSmUoFkY1BA8OpT8d 3gnmUlYw9GiM60/wlgnYHPB6twmMznNO5gxZS5oztz82Cq6qSc64bKtumV/2eJLZ2Wtr V4STiMw597q7/k7uLns4GtciMsHEDrKXbo4qvObmd9bxRTjDBalMJNmyLgci3KkSPxVv sGLg== ARC-Authentication-Results: i=1; mx.google.com; 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 10si1364914ois.76.2020.01.08.00.49.28; Wed, 08 Jan 2020 00:49:41 -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; 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 S1727402AbgAHIsq (ORCPT + 99 others); Wed, 8 Jan 2020 03:48:46 -0500 Received: from mx2.suse.de ([195.135.220.15]:36414 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727313AbgAHIsq (ORCPT ); Wed, 8 Jan 2020 03:48:46 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5AB81AD82; Wed, 8 Jan 2020 08:48:43 +0000 (UTC) Subject: Re: [PATCH] drm/hisilicon: add the mode_valid function To: Tian Tao , puck.chen@hisilicon.com, airlied@linux.ie, daniel@ffwll.ch, kraxel@redhat.com, alexander.deucher@amd.com, tglx@linutronix.de, dri-devel@lists.freedesktop.org, xinliang.liu@linaro.org, linux-kernel@vger.kernel.org Cc: linuxarm@huawei.com References: <1578471540-43322-1-git-send-email-tiantao6@hisilicon.com> From: Thomas Zimmermann Autocrypt: addr=tzimmermann@suse.de; keydata= mQENBFs50uABCADEHP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O/FISymJBHx2Dyoklv5g4BzkgqTqwmaYzsl8UxZKvbaxq0zb ehDda8lvhFXodNFMAgTLJlLuDYOGLK2AwbrS3Sp0AEbkpdJBb44qVlGm5bApZouHeJ/+n+7r 12+lqdsAEQEAAYkBPAQYAQgAJhYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJbOdLgAhsMBQkD wmcAAAoJEGgNwR1TC3ojpfcIAInwP5OlcEKokTnHCiDTz4Ony4GnHRP2fXATQZCKxmu4AJY2 h9ifw9Nf2TjCZ6AMvC3thAN0rFDj55N9l4s1CpaDo4J+0fkrHuyNacnT206CeJV1E7NYntxU n+LSiRrOdywn6erjxRi9EYTVLCHcDhBEjKmFZfg4AM4GZMWX1lg0+eHbd5oL1as28WvvI/uI aMyV8RbyXot1r/8QLlWldU3NrTF5p7TMU2y3ZH2mf5suSKHAMtbE4jKJ8ZHFOo3GhLgjVrBW HE9JXO08xKkgD+w6v83+nomsEuf6C6LYrqY/tsZvyEX6zN8CtirPdPWu/VXNRYAl/lat7lSI 3H26qrE= Message-ID: Date: Wed, 8 Jan 2020 09:48:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <1578471540-43322-1-git-send-email-tiantao6@hisilicon.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OZ3Z0Rm1PvXry6qAkJcWesTazNMCuYBUx" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OZ3Z0Rm1PvXry6qAkJcWesTazNMCuYBUx Content-Type: multipart/mixed; boundary="ujRMYAIfhnuseeewZLl362zPnio58F1kj"; protected-headers="v1" From: Thomas Zimmermann To: Tian Tao , puck.chen@hisilicon.com, airlied@linux.ie, daniel@ffwll.ch, kraxel@redhat.com, alexander.deucher@amd.com, tglx@linutronix.de, dri-devel@lists.freedesktop.org, xinliang.liu@linaro.org, linux-kernel@vger.kernel.org Cc: linuxarm@huawei.com Message-ID: Subject: Re: [PATCH] drm/hisilicon: add the mode_valid function References: <1578471540-43322-1-git-send-email-tiantao6@hisilicon.com> In-Reply-To: <1578471540-43322-1-git-send-email-tiantao6@hisilicon.com> --ujRMYAIfhnuseeewZLl362zPnio58F1kj Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi, here are a few more nits to fix. Am 08.01.20 um 09:19 schrieb Tian Tao: > add mode_valid function, and we can also use it to make suse the resolu= tion > is valid. Start with capital 'Add' and make it a simple sentence. Change 'suse' to 'sure' >=20 > Signed-off-by: Tian Tao > Signed-off-by: Gong junjie > --- > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 20 ++++++++++++++++++= ++ > 1 file changed, 20 insertions(+) >=20 > diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c b/drivers/g= pu/drm/hisilicon/hibmc/hibmc_drm_de.c > index 843d784..6cb7a79 100644 > --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c > +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c > @@ -242,6 +242,25 @@ static void hibmc_crtc_atomic_disable(struct drm_c= rtc *crtc, > hibmc_set_current_gate(priv, reg); > } > =20 > +enum drm_mode_status hibmc_crtc_mode_valid(struct drm_crtc *crtc, > + const struct drm_display_mode *mode) Please declare this function as static. > +{ > + int i =3D 0; > + int vrefresh =3D drm_mode_vrefresh(mode); > + > + if (vrefresh < 59 || vrefresh > 61) > + return MODE_NOMODE; I'd return MODE_NOCLOCK or MODE_CLOCK_RANGE. > + > + for (i =3D 0; i < ARRAY_SIZE(hibmc_pll_table); i++) { > + if (hibmc_pll_table[i].hdisplay =3D=3D mode->hdisplay && > + hibmc_pll_table[i].vdisplay =3D=3D mode->vdisplay) > + return MODE_OK; > + } > + > + return MODE_NOMODE; Maybe return MODE_BAD. MODE_NOMODE apparently refers to a descriptive string for the mode. > +} > + > + One one empty line please. With these fixes applied, you can add my Reviewed-by: Thomas Zimmermann Best regards Thomas > static unsigned int format_pll_reg(void) > { > unsigned int pllreg =3D 0; > @@ -510,6 +529,7 @@ static const struct drm_crtc_helper_funcs hibmc_crt= c_helper_funcs =3D { > .atomic_flush =3D hibmc_crtc_atomic_flush, > .atomic_enable =3D hibmc_crtc_atomic_enable, > .atomic_disable =3D hibmc_crtc_atomic_disable, > + .mode_valid =3D hibmc_crtc_mode_valid, > }; > =20 > int hibmc_de_init(struct hibmc_drm_private *priv) >=20 --=20 Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany (HRB 36809, AG N=C3=BCrnberg) Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer --ujRMYAIfhnuseeewZLl362zPnio58F1kj-- --OZ3Z0Rm1PvXry6qAkJcWesTazNMCuYBUx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAl4Vl2cACgkQaA3BHVML eiOtvQgAl+IKOBGin0jJPitb0wqB32GKS7u8kxNi8XOnM9YrgBAVf1kh2JEKQid4 uwPj9RXDKcvUPvQmPL/vtbnwW4bOC6Ozd5T4hLr/LFURtvLk7KPnLrCYaiYYLlpq dEy+hgizVw99TzD/os1Y9YipRQcfExiNKQZwoFpNC95csJENwPZuLdQpcacisQpZ bIo91OvPy/U9vpmqsrNYW7S9CMguPO0fQ2giSRkvVho88zCzsxwahI/SS4Ts0RJk IXhjiqytFxcRonvLJR272RqdCTH8LodVCbXFbXZTYasTsQDzXHXnz9vZvEK/eZwI +jl149f6VR4riTxQ5uDKMT9Ei0cWmw== =QA9q -----END PGP SIGNATURE----- --OZ3Z0Rm1PvXry6qAkJcWesTazNMCuYBUx--