All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
To: Mark Yacoub <markyacoub@chromium.org>
Cc: Petri Latvala <petri.latvala@intel.com>,
	Development mailing list for IGT GPU Tools
	<igt-dev@lists.freedesktop.org>,
	Sean Paul <seanpaul@chromium.org>,
	Mark Yacoub <markyacoub@google.com>
Subject: Re: [igt-dev] [PATCH] lib/igt_fb: Support Tile Size for AMD non linear modifiers.
Date: Fri, 18 Jun 2021 01:45:17 +0200	[thread overview]
Message-ID: <CAP+8YyGJLfaXZ1WFNJmcrkasBVZhGwf0-vWhCD-oGGXzWhgTnQ@mail.gmail.com> (raw)
In-Reply-To: <CAJUqKUrXr90ntQRCznp_DxFgp-zNavf2uSUxtncVykhm4Up=xQ@mail.gmail.com>

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>

though I'm not sure how useful it is without also appropriately
catching the stride weirdness wrt amdgpu.

On Mon, Jun 7, 2021 at 6:13 PM Mark Yacoub <markyacoub@chromium.org> wrote:
>
> friendly ping.
>
> On Tue, Apr 13, 2021 at 12:02 PM Mark Yacoub <markyacoub@chromium.org> wrote:
> >
> > From: Mark Yacoub <markyacoub@google.com>
> >
> > Calculate the width and height of the tile on amdgpu when the modifier
> > is not linear.
> >
> > Cc: bas@basnieuwenhuizen.nl
> > Cc: daniel.vetter@ffwll.ch
> > Signed-off-by: markyacoub@chromium.org
> > ---
> >  lib/igt_fb.c | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> >
> > diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> > index 4ded7e78..3d1fdae5 100644
> > --- a/lib/igt_fb.c
> > +++ b/lib/igt_fb.c
> > @@ -396,6 +396,19 @@ void igt_get_fb_tile_size(int fd, uint64_t modifier, int fb_bpp,
> >                 vc4_modifier_param = fourcc_mod_broadcom_param(modifier);
> >                 modifier = fourcc_mod_broadcom_mod(modifier);
> >         }
> > +       // For all non-linear modifiers, AMD uses 64 KiB tiles
> > +       else if (IS_AMD_FMT_MOD(modifier)) {
> > +               igt_require_amdgpu(fd);
> > +               const int bytes_per_pixel = fb_bpp / 8;
> > +               const int format_log2 = log2(bytes_per_pixel);
> > +               const int pixel_log2 = log2(64 * 1024) - format_log2;
> > +               const int width_log2 = (pixel_log2 + 1) / 2;
> > +               const int height_log2 = pixel_log2 - width_log2;
> > +
> > +               *width_ret = 1 << width_log2;
> > +               *height_ret = 1 << height_log2;
> > +               return;
> > +       }
> >
> >         switch (modifier) {
> >         case LOCAL_DRM_FORMAT_MOD_NONE:
> > --
> > 2.31.1.295.g9ea45b61b8-goog
> >
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2021-06-17 23:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 16:02 [igt-dev] [PATCH] lib/igt_fb: Support Tile Size for AMD non linear modifiers Mark Yacoub
2021-04-13 16:43 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-04-13 17:41 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-06-07 16:13 ` [igt-dev] [PATCH] " Mark Yacoub
2021-06-17 23:45   ` Bas Nieuwenhuizen [this message]
2021-06-18 10:40     ` Bas Nieuwenhuizen
2021-06-21 15:43       ` Mark Yacoub

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=CAP+8YyGJLfaXZ1WFNJmcrkasBVZhGwf0-vWhCD-oGGXzWhgTnQ@mail.gmail.com \
    --to=bas@basnieuwenhuizen.nl \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=markyacoub@chromium.org \
    --cc=markyacoub@google.com \
    --cc=petri.latvala@intel.com \
    --cc=seanpaul@chromium.org \
    /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 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.