[Intel-gfx] [PATCH v3 7/8] drm/i915: Bump gen4+ fb stride limit to 256KiB
Ville Syrjälä
ville.syrjala at linux.intel.com
Fri Sep 28 19:19:26 UTC 2018
On Tue, Sep 25, 2018 at 09:13:41PM +0100, Chris Wilson wrote:
> Quoting Ville Syrjala (2018-09-25 20:37:13)
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> >
> > With gtt remapping plugged in we can simply raise the stride
> > limit on gen4+. Let's just arbitraily pick 256 KiB as the limit.
> >
> > No remapping CCS because the virtual address of each page actually
> > matters due to the new hash mode
> > (WaCompressedResourceDisplayNewHashMode:skl,kbl etc.), and no remapping
> > on gen2/3 due to lack of fence on the remapped vma.
> >
> > v2: Rebase due to is_ccs_modifier()
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
> > 1 file changed, 13 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index eca873653fea..d533a6086169 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -2522,6 +2522,19 @@ static
> > u32 intel_fb_max_stride(struct drm_i915_private *dev_priv,
> > u32 pixel_format, u64 modifier)
> > {
> > + /*
> > + * Arbitrary limit for gen4+. We can deal with any page
> > + * aligned stride via GTT remapping. Gen2/3 need a fence
> > + * for tiled scanout which the remapped vma won't have,
> > + * so we don't allow remapping on those platforms.
> > + *
> > + * Also the new hash mode we use for CCS isn't compatible
> > + * with remapping as the virtual address of the pages
> > + * affects the compressed data.
> > + */
> > + if (INTEL_GEN(dev_priv) >= 4 && !is_ccs_modifier(modifier))
> > + return 256*1024;
>
> Worth using SZ_256K ?
That question prompted me to try a mass conversion. Managed to trick
cocci to do it more or less. Unfortunately it was a bit too greedy
and converted non-pot sizes as well. Not sure how much the SZ_ things
are worth due to that reason.
I couldn't get cocci to do what I wanted with ## so had to resort
to python. I get the impression that ## only works with identifiers.
Here's what I ended with in case anyone wants to evaluate for
themselves:
@find_m@
constant old_m =~ "^[0-9]*$";
@@
old_m * 1024 * 1024
@script:python rename_m@
input << find_m.old_m;
new_m;
@@
def do_rename_m(name):
return "SZ_" + name + "M"
coccinelle.new_m = cocci.make_ident(do_rename_m(input))
print coccinelle.new_m
@@
constant find_m.old_m;
identifier rename_m.new_m;
@@
- old_m * 1024 * 1024
+ new_m
@find_k@
constant old_k =~ "^[0-9]*$";
@@
old_k * 1024
@@
@@
- 1024 * 1024
+ SZ_1M
@script:python rename_k@
input << find_k.old_k;
new_k;
@@
def do_rename_k(name):
return "SZ_" + name + "K"
coccinelle.new_k = cocci.make_ident(do_rename_k(input))
print coccinelle.new_k
@@
constant find_k.old_k;
identifier rename_k.new_k;
@@
- old_k * 1024
+ new_k
--
Ville Syrjälä
Intel
More information about the Intel-gfx
mailing list