lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAF6AEGvsE_hxYYA123=55uvXVsDMkhfwvXW+gBMQJksE1WoQeg@mail.gmail.com>
Date:   Mon, 23 Sep 2019 09:53:40 -0700
From:   Rob Clark <robdclark@...il.com>
To:     Sandy Huang <hjc@...k-chips.com>
Cc:     dri-devel <dri-devel@...ts.freedesktop.org>,
        Sean Paul <sean@...rly.run>, David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Jeykumar Sankaran <jsanka@...eaurora.org>,
        Bruce Wang <bzwang@...omium.org>,
        Jordan Crouse <jcrouse@...eaurora.org>,
        Sravanthi Kollukuduru <skolluku@...eaurora.org>,
        Maxime Ripard <maxime.ripard@...tlin.com>,
        Sam Ravnborg <sam@...nborg.org>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Mamta Shukla <mamtashukla555@...il.com>,
        Shayenne Moura <shayenneluzmoura@...il.com>,
        Paul Kocialkowski <paul.kocialkowski@...tlin.com>,
        Emil Velikov <emil.velikov@...labora.com>,
        Allison Randal <allison@...utok.net>,
        Sean Paul <seanpaul@...omium.org>,
        Rob Clark <robdclark@...omium.org>,
        Daniel Vetter <daniel.vetter@...ll.ch>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        freedreno <freedreno@...ts.freedesktop.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 08/36] drm/msm: use bpp instead of cpp for drm_format_info

On Mon, Sep 23, 2019 at 5:44 AM Sandy Huang <hjc@...k-chips.com> wrote:
>
> cpp[BytePerPlane] can't describe the 10bit data format correctly,
> So we use bpp[BitPerPlane] to instead cpp.
>
> Signed-off-by: Sandy Huang <hjc@...k-chips.com>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c  | 4 ++--
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 2 +-
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c  | 2 +-
>  drivers/gpu/drm/msm/msm_fb.c              | 2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index b3417d5..c57731c 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -1148,8 +1148,8 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data)
>                                 fb->base.id, (char *) &fb->format->format,
>                                 fb->width, fb->height);
>                         for (i = 0; i < ARRAY_SIZE(fb->format->cpp); ++i)
> -                               seq_printf(s, "cpp[%d]:%u ",
> -                                               i, fb->format->cpp[i]);
> +                               seq_printf(s, "bpp[%d]:%u ",
> +                                               i, fb->format->bpp[i]);
>                         seq_puts(s, "\n\t");
>
>                         seq_printf(s, "modifier:%8llu ", fb->modifier);
> diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
> index ff14555..61ab4dc 100644
> --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
> @@ -790,7 +790,7 @@ static void mdp5_crtc_restore_cursor(struct drm_crtc *crtc)
>         width = mdp5_crtc->cursor.width;
>         height = mdp5_crtc->cursor.height;
>
> -       stride = width * info->cpp[0];
> +       stride = width * info->bpp[0] / 8;
>
>         get_roi(crtc, &roi_w, &roi_h);
>
> diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c
> index 776337f..992477d 100644
> --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c
> +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c
> @@ -147,7 +147,7 @@ uint32_t mdp5_smp_calculate(struct mdp5_smp *smp,
>         for (i = 0; i < nplanes; i++) {
>                 int n, fetch_stride, cpp;
>
> -               cpp = info->cpp[i];
> +               cpp = info->bpp[i] / 8;

Unless I missed something in your first patch, I don't think this
series is bisectable, ie. replacing cpp w/ bpp would cause everything
else not to compile.  Looks like there was an alternative proposal on
the first patch, but if we do end up going this route, I think you
should add bpp in the first patch, and remove cpp in the last patch.
(And also probably sprinkle around WARN_ON(info->bpp[n] % 8) in places
were it is expected to be a multiple of 8)

BR,
-R


>                 fetch_stride = width * cpp / (i ? hsub : 1);
>
>                 n = DIV_ROUND_UP(fetch_stride * nlines, smp->blk_size);
> diff --git a/drivers/gpu/drm/msm/msm_fb.c b/drivers/gpu/drm/msm/msm_fb.c
> index 5bcd5e5..4545fa1 100644
> --- a/drivers/gpu/drm/msm/msm_fb.c
> +++ b/drivers/gpu/drm/msm/msm_fb.c
> @@ -172,7 +172,7 @@ static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,
>                 unsigned int min_size;
>
>                 min_size = (height - 1) * mode_cmd->pitches[i]
> -                        + width * info->cpp[i]
> +                        + width * info->bpp[i] / 8
>                          + mode_cmd->offsets[i];
>
>                 if (bos[i]->size < min_size) {
> --
> 2.7.4
>
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ