From: Alyssa Rosenzweig <alyssa@rosenzweig.io> To: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: dri-devel@lists.freedesktop.org, "Neil Armstrong" <narmstrong@baylibre.com>, "David Airlie" <airlied@linux.ie>, "Daniel Vetter" <daniel@ffwll.ch>, "Kevin Hilman" <khilman@baylibre.com>, "Jerome Brunet" <jbrunet@baylibre.com>, "Martin Blumenstingl" <martin.blumenstingl@googlemail.com>, "Rob Clark" <robdclark@gmail.com>, "Sean Paul" <sean@poorly.run>, "Sandy Huang" <hjc@rock-chips.com>, "Heiko Stübner" <heiko@sntech.de>, "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>, "Maxime Ripard" <mripard@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "Abhinav Kumar" <abhinavk@codeaurora.org>, "Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>, "Lee Jones" <lee.jones@linaro.org>, "Stephen Boyd" <swboyd@chromium.org>, "Kalyan Thota" <kalyan_t@codeaurora.org>, "Ville Syrjälä" <ville.syrjala@linux.intel.com>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] drm: Add drm_fixed_16_16 helper Date: Wed, 1 Sep 2021 21:35:40 -0400 [thread overview] Message-ID: <YTAqbAhoYPe6Stjn@sunset> (raw) In-Reply-To: <YS/CsCSqKeFYF9x7@pendragon.ideasonboard.com> > Missing documentation :-) Ack. > > +static inline int drm_fixed_16_16(s32 mult, s32 div) > > You should return a s32. Ack. > The function name isn't very explicit, and departs from the naming > scheme of other functions in the same file. As fixed-point numbers are > stored in a s64 for the drm_fixp_* helpers, we shouldn't rese the > drm_fixp_ prefix, maybe drm_fixp_s16_16_ would be a good prefix. The > function should probably be named drm_fixp_s16_16 from_fraction() then, > but then the same logic should possibly be replicated to ensure optimal > precision. I wonder if it wouldn't be best to simply use > drm_fixp_from_fraction() and shift the result right by 16 bits. Sure, I'm not attached to the naming ... will wait to hear what colours everyone else wants the bikehed painted. As for the implementation, I just went with what was used across multiple drivers already (no chance of regressions that way) but could reuse other helpers if it's better..? If the behaviour changes this goes from a trivial cleanup to a much more invasive changeset. I don't own half of the hardware here.
WARNING: multiple messages have this Message-ID (diff)
From: Alyssa Rosenzweig <alyssa@rosenzweig.io> To: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: dri-devel@lists.freedesktop.org, "Neil Armstrong" <narmstrong@baylibre.com>, "David Airlie" <airlied@linux.ie>, "Daniel Vetter" <daniel@ffwll.ch>, "Kevin Hilman" <khilman@baylibre.com>, "Jerome Brunet" <jbrunet@baylibre.com>, "Martin Blumenstingl" <martin.blumenstingl@googlemail.com>, "Rob Clark" <robdclark@gmail.com>, "Sean Paul" <sean@poorly.run>, "Sandy Huang" <hjc@rock-chips.com>, "Heiko Stübner" <heiko@sntech.de>, "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>, "Maxime Ripard" <mripard@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "Abhinav Kumar" <abhinavk@codeaurora.org>, "Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>, "Lee Jones" <lee.jones@linaro.org>, "Stephen Boyd" <swboyd@chromium.org>, "Kalyan Thota" <kalyan_t@codeaurora.org>, "Ville Syrjälä" <ville.syrjala@linux.intel.com>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] drm: Add drm_fixed_16_16 helper Date: Wed, 1 Sep 2021 21:35:40 -0400 [thread overview] Message-ID: <YTAqbAhoYPe6Stjn@sunset> (raw) In-Reply-To: <YS/CsCSqKeFYF9x7@pendragon.ideasonboard.com> > Missing documentation :-) Ack. > > +static inline int drm_fixed_16_16(s32 mult, s32 div) > > You should return a s32. Ack. > The function name isn't very explicit, and departs from the naming > scheme of other functions in the same file. As fixed-point numbers are > stored in a s64 for the drm_fixp_* helpers, we shouldn't rese the > drm_fixp_ prefix, maybe drm_fixp_s16_16_ would be a good prefix. The > function should probably be named drm_fixp_s16_16 from_fraction() then, > but then the same logic should possibly be replicated to ensure optimal > precision. I wonder if it wouldn't be best to simply use > drm_fixp_from_fraction() and shift the result right by 16 bits. Sure, I'm not attached to the naming ... will wait to hear what colours everyone else wants the bikehed painted. As for the implementation, I just went with what was used across multiple drivers already (no chance of regressions that way) but could reuse other helpers if it's better..? If the behaviour changes this goes from a trivial cleanup to a much more invasive changeset. I don't own half of the hardware here. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-09-02 3:13 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-01 17:54 [PATCH 1/5] drm: Add drm_fixed_16_16 helper Alyssa Rosenzweig 2021-09-01 17:54 ` Alyssa Rosenzweig 2021-09-01 17:54 ` [PATCH 2/5] drm/meson: Use common " Alyssa Rosenzweig 2021-09-01 17:54 ` Alyssa Rosenzweig 2021-09-01 17:54 ` Alyssa Rosenzweig 2021-09-02 9:15 ` Neil Armstrong 2021-09-02 9:15 ` Neil Armstrong 2021-09-02 9:15 ` Neil Armstrong 2021-09-01 17:54 ` [PATCH 3/5] drm/msm: " Alyssa Rosenzweig 2021-09-01 17:54 ` Alyssa Rosenzweig 2021-09-01 17:54 ` [PATCH 4/5] drm/rockchip: " Alyssa Rosenzweig 2021-09-01 17:54 ` Alyssa Rosenzweig 2021-09-01 17:54 ` Alyssa Rosenzweig 2021-09-01 17:54 ` [PATCH 5/5] drm/zte: " Alyssa Rosenzweig 2021-09-01 17:54 ` Alyssa Rosenzweig 2021-09-01 18:13 ` [PATCH 1/5] drm: Add " Laurent Pinchart 2021-09-01 18:13 ` Laurent Pinchart 2021-09-02 1:35 ` Alyssa Rosenzweig [this message] 2021-09-02 1:35 ` Alyssa Rosenzweig 2021-09-02 3:22 ` Laurent Pinchart 2021-09-02 3:22 ` Laurent Pinchart
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=YTAqbAhoYPe6Stjn@sunset \ --to=alyssa@rosenzweig.io \ --cc=abhinavk@codeaurora.org \ --cc=airlied@linux.ie \ --cc=daniel@ffwll.ch \ --cc=dmitry.baryshkov@linaro.org \ --cc=dri-devel@lists.freedesktop.org \ --cc=heiko@sntech.de \ --cc=hjc@rock-chips.com \ --cc=jbrunet@baylibre.com \ --cc=kalyan_t@codeaurora.org \ --cc=khilman@baylibre.com \ --cc=laurent.pinchart@ideasonboard.com \ --cc=lee.jones@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=maarten.lankhorst@linux.intel.com \ --cc=martin.blumenstingl@googlemail.com \ --cc=mripard@kernel.org \ --cc=narmstrong@baylibre.com \ --cc=robdclark@gmail.com \ --cc=sean@poorly.run \ --cc=swboyd@chromium.org \ --cc=tzimmermann@suse.de \ --cc=ville.syrjala@linux.intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.