From: "Govindapillai, Vinod" <vinod.govindapillai@intel.com>
To: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
"Cavitt, Jonathan" <jonathan.cavitt@intel.com>
Cc: "Heikkila, Juha-pekka" <juha-pekka.heikkila@intel.com>,
"Hogander, Jouni" <jouni.hogander@intel.com>
Subject: Re: [PATCH i-g-t 2/4] lib/i915/fbc: add fbc frame size check helper
Date: Mon, 10 Jun 2024 12:05:35 +0000 [thread overview]
Message-ID: <68a3dac62e8845c69a82fbae0fea515e865524ce.camel@intel.com> (raw)
In-Reply-To: <CH0PR11MB54444335CA4C7A68D324DE32E5FB2@CH0PR11MB5444.namprd11.prod.outlook.com>
On Fri, 2024-06-07 at 20:42 +0000, Cavitt, Jonathan wrote:
> -----Original Message-----
> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Vinod Govindapillai
> Sent: Friday, June 7, 2024 7:58 AM
> To: igt-dev@lists.freedesktop.org
> Cc: Govindapillai, Vinod <vinod.govindapillai@intel.com>; Heikkila, Juha-pekka
> <juha-pekka.heikkila@intel.com>; Hogander, Jouni <jouni.hogander@intel.com>
> Subject: [PATCH i-g-t 2/4] lib/i915/fbc: add fbc frame size check helper
> >
> > Add a helper function to check maximum plane size fbc can be
> > supported in a display version.
> >
> > Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
> > ---
> > lib/i915/intel_fbc.c | 36 ++++++++++++++++++++++++++++++++++++
> > lib/i915/intel_fbc.h | 1 +
> > 2 files changed, 37 insertions(+)
> >
> > diff --git a/lib/i915/intel_fbc.c b/lib/i915/intel_fbc.c
> > index 07ed7f469..992e9c4de 100644
> > --- a/lib/i915/intel_fbc.c
> > +++ b/lib/i915/intel_fbc.c
> > @@ -99,3 +99,39 @@ bool intel_fbc_wait_until_enabled(int device, enum pipe pipe)
> >
> > return enabled;
> > }
> > +
> > +/**
> > + * intel_fbc_plane_size_supported
> > + *
> > + * @fd: fd of the device
> > + * @width: width of the plane
> > + * @height: height of the plane
> > + *
> > + * Checks if the plane size supported for FBC
> > + *
> > + * Returns:
> > + * true if plane size is within the range as per the FBC supported size restrictions per
> > platform
> > + */
> > +bool intel_fbc_plane_size_supported(int fd, uint32_t width, uint32_t height)
> > +{
> > + const uint32_t dev_id = intel_get_drm_devid(fd);
> > + const struct intel_device_info *info = intel_get_device_info(dev_id);
> > + int ver = info->graphics_ver;
> > + unsigned int max_w, max_h;
> > +
> > + if (ver >= 10) {
> > + max_w = 5120;
> > + max_h = 4096;
> > + } else if (ver >= 8 || IS_HASWELL(fd)) {
> > + max_w = 4096;
> > + max_h = 4096;
> > + } else if (IS_G4X(fd) || ver >= 5) {
> > + max_w = 4096;
> > + max_h = 2048;
> > + } else {
> > + max_w = 2048;
> > + max_h = 1536;
> > + }
> > +
> > + return width <= max_w && height <= max_h;
> > +}
>
> It might also be helpful to have a separate function that returns the max fcb
> plane size supported as a raw value in case any tests wanted to operate on the
> full fcb plane. Say:
>
> int intel_fbc_max_plane_size(int device, uint32_t *width, uint32_t *height)
>
> This could store the width and height generated above and be used as a helper
> function for intel_fbc_plane_size_supported. I also don't know if fcb could be
> unsupported at some point, but the int return value could be used for any errors.
Thanks for the good suggestion! I have now updated the patch series. There was a build issue as well
related to another patch in the prev series.
I cant think of a error case when the size check is performed! So right now not returning any error
code! Any FBC support related error scenario should be handled outside of this size check I think.
BR
Vinod
>
> This is just something to consider. I won't block on it:
> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> -Jonathan Cavitt
>
>
> > diff --git a/lib/i915/intel_fbc.h b/lib/i915/intel_fbc.h
> > index 995dc7f1e..f05b351f6 100644
> > --- a/lib/i915/intel_fbc.h
> > +++ b/lib/i915/intel_fbc.h
> > @@ -14,5 +14,6 @@
> > bool intel_fbc_supported_on_chipset(int device, enum pipe pipe);
> > bool intel_fbc_wait_until_enabled(int device, enum pipe pipe);
> > bool intel_fbc_is_enabled(int device, enum pipe pipe, int log_level);
> > +bool intel_fbc_plane_size_supported(int device, uint32_t width, uint32_t height);
> >
> > #endif
> > --
> > 2.34.1
> >
> >
next prev parent reply other threads:[~2024-06-10 12:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-07 14:57 [PATCH i-g-t 0/4] tests/kms_dirtyfb: few fbc related updates Vinod Govindapillai
2024-06-07 14:57 ` [PATCH i-g-t 1/4] lib/i915/fbc: print current fbc status if cannot be enabled Vinod Govindapillai
2024-06-07 20:21 ` Cavitt, Jonathan
2024-06-07 14:57 ` [PATCH i-g-t 2/4] lib/i915/fbc: add fbc frame size check helper Vinod Govindapillai
2024-06-07 20:42 ` Cavitt, Jonathan
2024-06-10 12:05 ` Govindapillai, Vinod [this message]
2024-06-07 14:57 ` [PATCH i-g-t 3/4] tests/kms_dirtyfb: disable psr feature only if psr possible Vinod Govindapillai
2024-06-07 20:43 ` Cavitt, Jonathan
2024-06-07 14:57 ` [PATCH i-g-t 4/4] tests/kms_dirtyfb: ensure plane size is within fbc supported limit Vinod Govindapillai
2024-06-07 20:44 ` Cavitt, Jonathan
2024-06-07 22:08 ` ✗ Fi.CI.BUILD: failure for tests/kms_dirtyfb: few fbc related updates Patchwork
2024-06-07 22:13 ` ✗ GitLab.Pipeline: warning " Patchwork
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=68a3dac62e8845c69a82fbae0fea515e865524ce.camel@intel.com \
--to=vinod.govindapillai@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jonathan.cavitt@intel.com \
--cc=jouni.hogander@intel.com \
--cc=juha-pekka.heikkila@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: 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