From: Bjorn Andersson <andersson@kernel.org>
To: Marijn Suijten <marijn.suijten@somainline.org>
Cc: David Airlie <airlied@linux.ie>,
Konrad Dybcio <konrad.dybcio@somainline.org>,
dri-devel@lists.freedesktop.org,
Javier Martinez Canillas <javierm@redhat.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@somainline.org>,
phone-devel@vger.kernel.org, Marek Vasut <marex@denx.de>,
linux-arm-msm@vger.kernel.org,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Martin Botka <martin.botka@somainline.org>,
~postmarketos/upstreaming@lists.sr.ht,
Sean Paul <sean@poorly.run>,
Jami Kettunen <jami.kettunen@somainline.org>,
Vladimir Lypak <vladimir.lypak@gmail.com>,
Douglas Anderson <dianders@chromium.org>,
linux-kernel@vger.kernel.org, Vinod Koul <vkoul@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
Alex Deucher <alexander.deucher@amd.com>,
freedreno@lists.freedesktop.org
Subject: Re: [PATCH 1/5] drm/msm/dsi: Remove useless math in DSC calculation
Date: Mon, 3 Oct 2022 19:26:50 -0500 [thread overview]
Message-ID: <20221004002650.joqwhmvzql55ospz@baldur> (raw)
In-Reply-To: <20221001190807.358691-2-marijn.suijten@somainline.org>
On Sat, Oct 01, 2022 at 09:08:03PM +0200, Marijn Suijten wrote:
> Multiplying a value by 2 and adding 1 to it always results in a value
> that is uneven, and that 1 gets truncated immediately when performing
> integer division by 2 again. There is no "rounding" possible here.
>
> Fixes: b9080324d6ca ("drm/msm/dsi: add support for dsc data")
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
> ---
> drivers/gpu/drm/msm/dsi/dsi_host.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index 8e4bc586c262..e05bae647431 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -1864,12 +1864,7 @@ static int dsi_populate_dsc_params(struct drm_dsc_config *dsc)
> data = 2048 * (dsc->rc_model_size - dsc->initial_offset + num_extra_mux_bits);
> dsc->slice_bpg_offset = DIV_ROUND_UP(data, groups_total);
>
> - /* bpp * 16 + 0.5 */
> - data = dsc->bits_per_pixel * 16;
> - data *= 2;
> - data++;
> - data /= 2;
> - target_bpp_x16 = data;
> + target_bpp_x16 = dsc->bits_per_pixel * 16;
>
> data = (dsc->initial_xmit_delay * target_bpp_x16) / 16;
> final_value = dsc->rc_model_size - data + num_extra_mux_bits;
> --
> 2.37.3
>
next prev parent reply other threads:[~2022-10-04 0:27 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-01 19:08 [PATCH 0/5] drm: Fix math issues in MSM DSC implementation Marijn Suijten
2022-10-01 19:08 ` [PATCH 1/5] drm/msm/dsi: Remove useless math in DSC calculation Marijn Suijten
2022-10-01 20:19 ` Konrad Dybcio
2022-10-04 0:26 ` Bjorn Andersson [this message]
2022-10-04 14:33 ` [Freedreno] " Abhinav Kumar
2022-10-04 22:23 ` Marijn Suijten
2022-10-01 19:08 ` [PATCH 2/5] drm/msm/dsi: Remove repeated calculation of slice_per_intf Marijn Suijten
2022-10-01 20:22 ` Konrad Dybcio
2022-10-04 0:30 ` Bjorn Andersson
2022-10-04 14:41 ` Abhinav Kumar
2022-10-01 19:08 ` [PATCH 3/5] drm/msm/dsi: Account for DSC's bits_per_pixel having 4 fractional bits Marijn Suijten
2022-10-01 20:28 ` Konrad Dybcio
2022-10-01 20:37 ` Marijn Suijten
2022-10-04 14:45 ` Dmitry Baryshkov
2022-10-04 22:35 ` Marijn Suijten
2022-10-04 22:40 ` Dmitry Baryshkov
2022-10-04 22:56 ` Marijn Suijten
2022-10-01 19:08 ` [PATCH 4/5] drm/msm/dpu1: " Marijn Suijten
2022-10-04 14:35 ` Dmitry Baryshkov
2022-10-04 17:03 ` Abhinav Kumar
2022-10-04 22:11 ` Marijn Suijten
2022-10-05 14:19 ` Abhinav Kumar
2022-10-05 18:45 ` Marijn Suijten
2022-10-01 19:08 ` [PATCH 5/5] drm/dsc: Prevent negative BPG offsets from shadowing adjacent bitfields Marijn Suijten
2022-10-01 20:23 ` Marijn Suijten
2022-10-04 14:41 ` Dmitry Baryshkov
2022-10-04 21:48 ` Marijn Suijten
2022-10-04 20:22 ` Abhinav Kumar
2022-10-04 21:57 ` Marijn Suijten
2022-10-04 22:31 ` Abhinav Kumar
2022-10-04 22:39 ` Marijn Suijten
2022-10-05 15:33 ` Abhinav Kumar
2022-10-05 18:29 ` Marijn Suijten
2022-10-04 4:42 ` [PATCH 0/5] drm: Fix math issues in MSM DSC implementation Vinod Koul
2022-10-04 9:51 ` Marijn Suijten
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=20221004002650.joqwhmvzql55ospz@baldur \
--to=andersson@kernel.org \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=angelogioacchino.delregno@somainline.org \
--cc=dianders@chromium.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jami.kettunen@somainline.org \
--cc=javierm@redhat.com \
--cc=konrad.dybcio@somainline.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marex@denx.de \
--cc=marijn.suijten@somainline.org \
--cc=martin.botka@somainline.org \
--cc=phone-devel@vger.kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=sean@poorly.run \
--cc=tzimmermann@suse.de \
--cc=vkoul@kernel.org \
--cc=vladimir.lypak@gmail.com \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).