From: Tomi Valkeinen Subject: Re: [PATCH v2] drm/tilcdc: Precalculate total frametime in tilcdc_crtc_set_mode() Date: Fri, 13 Oct 2017 15:32:01 +0300 Message-ID: <201710131232.v9DCWCkF025730@dflxv15.itg.ti.com> References: <1507887353-30360-1-git-send-email-jsarha@ti.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="_c5032956-f69d-4581-8304-1e5448e28c3f_" Return-path: Received: from lelnx194.ext.ti.com (lelnx194.ext.ti.com [198.47.27.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E9646EAEA for ; Fri, 13 Oct 2017 12:32:15 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Jyri Sarha , dri-devel@lists.freedesktop.org Cc: laurent.pinchart@ideasonboard.com, stable@vger.kernel.org, kexin.hao@windriver.com List-Id: dri-devel@lists.freedesktop.org --_c5032956-f69d-4581-8304-1e5448e28c3f_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable =EF=BB=BFThis message contains a digitally signed email which can be read b= y opening the attachment. Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Bu= siness ID: 0615521-4. Kotipaikka/Domicile: Helsinki --_c5032956-f69d-4581-8304-1e5448e28c3f_ Content-Type: message/rfc822 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Fri, 13 Oct 2017 07:32:11 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Fri, 13 Oct 2017 07:32:11 -0500 Received: from [192.168.2.10] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v9DCW9oe024520; Fri, 13 Oct 2017 07:32:10 -0500 Subject: Re: [PATCH v2] drm/tilcdc: Precalculate total frametime in tilcdc_crtc_set_mode() To: Jyri Sarha , CC: , , , References: <1507887353-30360-1-git-send-email-jsarha@ti.com> From: Tomi Valkeinen Message-ID: <5295a3a0-5dac-64fc-9526-875b93495ec1@ti.com> Date: Fri, 13 Oct 2017 15:32:01 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="_387468fa-c408-47f9-939c-9ef9ec545d4e_" Return-Path: tomi.valkeinen@ti.com --_387468fa-c408-47f9-939c-9ef9ec545d4e_ Content-Type: multipart/mixed; boundary="odvgeuqBvJH2xgH7eIgQr1VErOcEJXM4P"; protected-headers=v1 From: Tomi Valkeinen To: Jyri Sarha , dri-devel@lists.freedesktop.org CC: airlied@linux.ie, laurent.pinchart@ideasonboard.com, kexin.hao@windriver.com, stable@vger.kernel.org Message-ID: <5295a3a0-5dac-64fc-9526-875b93495ec1@ti.com> Subject: Re: [PATCH v2] drm/tilcdc: Precalculate total frametime in tilcdc_crtc_set_mode() References: <1507887353-30360-1-git-send-email-jsarha@ti.com> In-Reply-To: --odvgeuqBvJH2xgH7eIgQr1VErOcEJXM4P Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 13/10/17 15:00, Jyri Sarha wrote: > On 10/13/17 14:04, Tomi Valkeinen wrote: >>> +uint tilcdc_mode_hvtotal(const struct drm_display_mode *mode) >>> +{ >>> + uint ret; >>> + >>> + ret =3D (uint) div_u64(1000llu * mode->htotal * mode->vtotal, >>> + mode->clock); >>> + >>> + return ret; >>> +} >> I don't think "uint" is recommended. Just use u32. And drop the ret >> variable, just one-line return statement should be enough. >> >=20 > The ret variable can of course be dropped, but how u32 is better than > uint? If the driver would ever be used in 64bit architecture (highly > unlikely), then it would automatically use the higher precision, and on= > 32-bit architecture there is no difference. I think int is normally 32 bit on 64 bit platforms too. But that depends on compiler flags. Where does "uint" come from anyway? I don't think it's part of a C standa= rd. > Also the data member in the private struct is uint and so are the other= > similar data members like lcd_fck_rate. Ok. Well, it's good to stick to one way of doing things, so maybe uint is fine. For any new code, I would not recommend using it. Tomi --odvgeuqBvJH2xgH7eIgQr1VErOcEJXM4P-- --_387468fa-c408-47f9-939c-9ef9ec545d4e_ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJZ4LJJAAoJEPo9qoy8lh71o4cP/0LZ0YiWnfuVwRuUoaafowJD LqXK7ePUeIhacMH7Df0ZSwp6F+XugM2Xg3sI0ldwy70703RNIBwIJpE3jafeWRr0 2ssmNR1OlEkqYiZq8R/oGEqp8tvb9ujoArS6FfOaVUeOOXGESGMMVFc/x3mTq+Jj HShadawdYJYSkIB8xHgeoaA3MOwPnviMDSlcc70r8dPiRDqoFhbfF/xFvMNuWBPb qikwjift0Uqix3So78/SoFR8CiMRPPAbvv8sv8Lfr+zub4H/bL1wr6Eq9Kbi6Ru9 gNay3rXN218kWgh5z1cZpwv8VHHOPgiQDz0SHXfZVXv8tTW6YcEYn8y6e+38Ftx4 yaeDxT0H2z/9CcqMd9bpPHjQqVFS7liIThRYM6ALvvAU+DHhXJmNJkiy9eJNPOv7 At+aEMe/q2XxAWyOykYry3JmtVZss14lNjiwaIcWsbWcr0zN3djTYOV4rKwVogTE G7/MpavisCc2f78F6oOH3Ge36LaAm2rl/Ox5ZkhGHENEQFJ1Iuks8zRlHrgLWP1p AxE2OKtH3ER3aGdE+Nmy2Y0edIEZ72JnBivw/wyZd/XkrJUmvzHh0EsxNEip0Uvs c+JAZumtknAqmUfHZXcFPszNazNTwSXUVufK/A7mUFmXGq3uTXFr83Ga5EuwNEca gtcCcw+jTfk2tYVAIPn+ =GIP9 -----END PGP SIGNATURE----- --_387468fa-c408-47f9-939c-9ef9ec545d4e_-- --_c5032956-f69d-4581-8304-1e5448e28c3f_ Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --_c5032956-f69d-4581-8304-1e5448e28c3f_--