From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/4] drm/i915: Generalize pci quirks
Date: Mon, 25 Feb 2019 15:38:00 +0200 [thread overview]
Message-ID: <20190225133800.GA20097@intel.com> (raw)
In-Reply-To: <8736ocro99.fsf@intel.com>
On Mon, Feb 25, 2019 at 03:28:18PM +0200, Jani Nikula wrote:
> On Mon, 25 Feb 2019, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> > On Fri, 22 Feb 2019, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> >> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >>
> >> Add support for multiple independent pci quirk tables.
> >> I want to reuse the quirk table approach for some
> >> watermark quirks but I prefer to keep the details in
> >> one place rather than spreading them all over.
> >>
> >> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>
> Hmm. Not to block the series, but this got me thinking. See
> e.g. QUIRK_BACKLIGHT_PRESENT or QUIRK_INVERT_BRIGHTNESS. Should we
> localize those to their own quirk tables in intel_panel.c now?
Might be nice.
However we seem to have a sole DMI quirk for some backlight
stuff. That would need to be handled somehow as well.
>
> What if intel_apply_pci_quirks() returned an OR of the return values of
> the hooks. In a few cases we could nuke the use of dev_priv->quirks in
> favor of more localized quirks. The former backlight quirk need not be
> saved at all, it's a one time check, and the latter could be saved in
> the backlight struct.
>
> Something for the future, perhaps.
>
> BR,
> Jani.
>
>
> >
> >> ---
> >> drivers/gpu/drm/i915/intel_drv.h | 9 +++++++++
> >> drivers/gpu/drm/i915/intel_quirks.c | 28 +++++++++++++++-------------
> >> 2 files changed, 24 insertions(+), 13 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> >> index 81ec73e4a083..8924b43d6e99 100644
> >> --- a/drivers/gpu/drm/i915/intel_drv.h
> >> +++ b/drivers/gpu/drm/i915/intel_drv.h
> >> @@ -2187,7 +2187,16 @@ int intel_psr_wait_for_idle(const struct intel_crtc_state *new_crtc_state,
> >> bool intel_psr_enabled(struct intel_dp *intel_dp);
> >>
> >> /* intel_quirks.c */
> >> +struct intel_pci_quirk {
> >> + int device;
> >> + int subsystem_vendor;
> >> + int subsystem_device;
> >> + void (*hook)(struct drm_i915_private *i915);
> >> +};
> >> +
> >> void intel_init_quirks(struct drm_i915_private *dev_priv);
> >> +void intel_apply_pci_quirks(struct drm_i915_private *i915,
> >> + const struct intel_pci_quirk *quirks);
> >>
> >> /* intel_runtime_pm.c */
> >> void intel_runtime_pm_init_early(struct drm_i915_private *dev_priv);
> >> diff --git a/drivers/gpu/drm/i915/intel_quirks.c b/drivers/gpu/drm/i915/intel_quirks.c
> >> index ec2b0fc92b8b..e073510553a6 100644
> >> --- a/drivers/gpu/drm/i915/intel_quirks.c
> >> +++ b/drivers/gpu/drm/i915/intel_quirks.c
> >> @@ -52,13 +52,6 @@ static void quirk_increase_ddi_disabled_time(struct drm_i915_private *i915)
> >> DRM_INFO("Applying Increase DDI Disabled quirk\n");
> >> }
> >>
> >> -struct intel_quirk {
> >> - int device;
> >> - int subsystem_vendor;
> >> - int subsystem_device;
> >> - void (*hook)(struct drm_i915_private *i915);
> >> -};
> >> -
> >> /* For systems that don't have a meaningful PCI subdevice/subvendor ID */
> >> struct intel_dmi_quirk {
> >> void (*hook)(struct drm_i915_private *i915);
> >> @@ -87,7 +80,7 @@ static const struct intel_dmi_quirk intel_dmi_quirks[] = {
> >> },
> >> };
> >>
> >> -static struct intel_quirk intel_quirks[] = {
> >> +static const struct intel_pci_quirk intel_pci_quirks[] = {
> >> /* Lenovo U160 cannot use SSC on LVDS */
> >> { 0x0046, 0x17aa, 0x3920, quirk_ssc_force_disable },
> >>
> >> @@ -145,16 +138,17 @@ static struct intel_quirk intel_quirks[] = {
> >> /* ASRock ITX*/
> >> { 0x3185, 0x1849, 0x2212, quirk_increase_ddi_disabled_time },
> >> { 0x3184, 0x1849, 0x2212, quirk_increase_ddi_disabled_time },
> >> +
> >> + {}
> >> };
> >>
> >> -void intel_init_quirks(struct drm_i915_private *i915)
> >> +void intel_apply_pci_quirks(struct drm_i915_private *i915,
> >> + const struct intel_pci_quirk *quirks)
> >> {
> >> struct pci_dev *d = i915->drm.pdev;
> >> - int i;
> >> -
> >> - for (i = 0; i < ARRAY_SIZE(intel_quirks); i++) {
> >> - struct intel_quirk *q = &intel_quirks[i];
> >> + const struct intel_pci_quirk *q;
> >>
> >> + for (q = quirks; q->device; q++) {
> >> if (d->device == q->device &&
> >> (d->subsystem_vendor == q->subsystem_vendor ||
> >> q->subsystem_vendor == PCI_ANY_ID) &&
> >> @@ -162,6 +156,14 @@ void intel_init_quirks(struct drm_i915_private *i915)
> >> q->subsystem_device == PCI_ANY_ID))
> >> q->hook(i915);
> >> }
> >> +}
> >> +
> >> +void intel_init_quirks(struct drm_i915_private *i915)
> >> +{
> >> + int i;
> >> +
> >> + intel_apply_pci_quirks(i915, intel_pci_quirks);
> >> +
> >> for (i = 0; i < ARRAY_SIZE(intel_dmi_quirks); i++) {
> >> if (dmi_check_system(*intel_dmi_quirks[i].dmi_id_list) != 0)
> >> intel_dmi_quirks[i].hook(i915);
>
> --
> Jani Nikula, Intel Open Source Graphics Center
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-02-25 13:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-22 15:52 [PATCH 1/4] drm/i915: Disable LP1+ watermarks on Lenovo Thinkpad T431s Ville Syrjala
2019-02-22 15:52 ` Ville Syrjala
2019-02-22 15:52 ` [PATCH 2/4] drm/i915: Generalize pci quirks Ville Syrjala
2019-02-25 13:12 ` Jani Nikula
2019-02-25 13:28 ` Jani Nikula
2019-02-25 13:38 ` Ville Syrjälä [this message]
2019-02-22 15:52 ` [PATCH 3/4] drm/i915: Use intel_apply_pci_quirks() to apply ILK+ wm quirks Ville Syrjala
2019-02-25 13:14 ` Jani Nikula
2019-02-25 13:28 ` Ville Syrjälä
2019-02-22 15:52 ` [PATCH 4/4] drm/i915: Restrict SNB LP3+ disable to Thinkpad X220 tablet Ville Syrjala
2019-02-25 13:18 ` Jani Nikula
2019-02-25 15:45 ` Ville Syrjälä
2019-02-25 16:11 ` Ville Syrjälä
2019-02-22 16:02 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/i915: Disable LP1+ watermarks on Lenovo Thinkpad T431s Patchwork
2019-02-22 16:29 ` ✓ Fi.CI.BAT: success " Patchwork
2019-02-23 1:58 ` ✓ Fi.CI.IGT: " Patchwork
2019-02-25 13:19 ` [PATCH 1/4] " Jani Nikula
2019-02-25 13:19 ` [Intel-gfx] " Jani Nikula
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=20190225133800.GA20097@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.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.