From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Intel graphics driver community testing & development
<intel-gfx@lists.freedesktop.org>,
Mika Kuoppala <mika.kuoppala@intel.com>
Subject: Re: [PATCH 2/2] drm/i915: Function per early graphics quirk
Date: Fri, 22 Apr 2016 15:07:42 +0300 [thread overview]
Message-ID: <1461326862.4667.6.camel@linux.intel.com> (raw)
In-Reply-To: <20160422115546.GD17454@nuc-i3427.alporthouse.com>
On pe, 2016-04-22 at 12:55 +0100, Chris Wilson wrote:
> On Fri, Apr 22, 2016 at 02:25:07PM +0300, Joonas Lahtinen wrote:
> >
> > Move graphics stolen memory related early quirk into a function to
> > allow easy adding of other graphics quirks to fix memory maps on
> > machines running old BIOS versions.
> >
> > While at it;
> > - _funcs -> _ops to follow de facto naming
> > - make the iteration code tad more readable
> > - remove unused variables
> >
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> > Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Mechanical again, and less quirky,
> Reserved-by: Chris Wilson <chris@chris-wilson.co.uk>
A new type of R-b? :)
>
> >
> > -static void __init intel_graphics_stolen(int num, int slot, int func)
> > +static void __init
> > +intel_graphics_stolen(int num, int slot, int func,
> > + const struct intel_early_ops *early_ops)
> > {
> > + phys_addr_t base;
> > size_t size;
> > +
> > + size = early_ops->stolen_size(num, slot, func);
> > + base = early_ops->stolen_base(num, slot, func, size);
> > +
> > + if (!size || !base)
> > + return;
> if (size + base < base)
> return;
>
> Just in case? Hmm, not sure if the integer sizes will always be suitable
> for the test, so probably just trust the hardware registers?
(This was actually the test used by earlier version of code too.
Intention was to not change the resulting logic that much. So I'd add
this check as a follow-up.)
I don't see how this could happen, the original hardware registers are
unlikely to cause an overflow of the phys_addr_t. If we want to add a
check, we should rather test against e820_end_of_ram_pfn() or so.
Regards, Joonas
> -Chris
>
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-04-22 12:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-22 11:25 Cleanup of early quirks Joonas Lahtinen
2016-04-22 11:25 ` [PATCH 1/2] drm/i915: Canonicalize stolen memory calculations Joonas Lahtinen
2016-04-22 11:48 ` Chris Wilson
2016-04-27 10:50 ` Joonas Lahtinen
2016-04-22 11:25 ` [PATCH 2/2] drm/i915: Function per early graphics quirk Joonas Lahtinen
2016-04-22 11:55 ` Chris Wilson
2016-04-22 12:07 ` Joonas Lahtinen [this message]
2016-04-22 12:17 ` Chris Wilson
2016-04-22 12:28 ` [PATCH v2 1/2] drm/i915: Canonicalize stolen memory calculations Joonas Lahtinen
2016-04-22 12:28 ` [PATCH v2 2/2] drm/i915: Function per early graphics quirk Joonas Lahtinen
2016-04-27 10:52 ` Joonas Lahtinen
2016-04-22 13:32 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: Canonicalize stolen memory calculations (rev2) Patchwork
2016-04-24 7:53 ` Patchwork
2016-04-25 8:54 ` Joonas Lahtinen
2016-04-25 9:23 ` Tvrtko Ursulin
2016-04-25 10:35 ` Joonas Lahtinen
2016-04-25 10:49 ` Mika Kuoppala
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=1461326862.4667.6.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mika.kuoppala@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 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.