* [PATCH] drm/i915: refine qemu south bridge detection
@ 2016-01-25 7:55 Gerd Hoffmann
2016-01-25 8:32 ` Jani Nikula
0 siblings, 1 reply; 4+ messages in thread
From: Gerd Hoffmann @ 2016-01-25 7:55 UTC (permalink / raw)
To: intel-gfx
Cc: daniel.vetter,
open list:INTEL DRM DRIVERS excluding Poulsbo, Moorestow..., linux-kernel@vger.kernel.org open list,
Daniel Vetter, bjorn
The test for the qemu q35 south bridge added by commit
"39bfcd52 drm/i915: more virtual south bridge detection"
also matches on real hardware. Having the check for
virtual systems last in the list is not enough to avoid
that ...
Refine the check by additionally verifying the pci
subsystem id to see whenever it *really* is qemu.
Reported-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
drivers/gpu/drm/i915/i915_drv.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 3ac616d..9668162 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -501,7 +501,9 @@ void intel_detect_pch(struct drm_device *dev)
WARN_ON(!IS_SKYLAKE(dev) &&
!IS_KABYLAKE(dev));
} else if ((id == INTEL_PCH_P2X_DEVICE_ID_TYPE) ||
- (id == INTEL_PCH_QEMU_DEVICE_ID_TYPE)) {
+ ((id == INTEL_PCH_QEMU_DEVICE_ID_TYPE) &&
+ pch->subsystem_vendor == 0x1a4f &&
+ pch->subsystem_device == 0x1100)) {
dev_priv->pch_type = intel_virt_detect_pch(dev);
} else
continue;
--
1.8.3.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: refine qemu south bridge detection
2016-01-25 7:55 [PATCH] drm/i915: refine qemu south bridge detection Gerd Hoffmann
@ 2016-01-25 8:32 ` Jani Nikula
2016-01-25 9:11 ` Bjørn Mork
0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2016-01-25 8:32 UTC (permalink / raw)
To: Gerd Hoffmann, intel-gfx
Cc: daniel.vetter,
open list:INTEL DRM DRIVERS (excluding Poulsbo, Moorestow...), linux-kernel@vger.kernel.org (open list),
Daniel Vetter, bjorn
On Mon, 25 Jan 2016, Gerd Hoffmann <kraxel@redhat.com> wrote:
> The test for the qemu q35 south bridge added by commit
> "39bfcd52 drm/i915: more virtual south bridge detection"
> also matches on real hardware. Having the check for
> virtual systems last in the list is not enough to avoid
> that ...
>
> Refine the check by additionally verifying the pci
> subsystem id to see whenever it *really* is qemu.
>
> Reported-by: Bjørn Mork <bjorn@mork.no>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Already sent the revert in [1], but I'm fine with this if it works for
Bjørn.
BR,
Jani.
[1] http://mid.gmane.org/1453710360-30099-1-git-send-email-jani.nikula@intel.com
> ---
> drivers/gpu/drm/i915/i915_drv.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 3ac616d..9668162 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -501,7 +501,9 @@ void intel_detect_pch(struct drm_device *dev)
> WARN_ON(!IS_SKYLAKE(dev) &&
> !IS_KABYLAKE(dev));
> } else if ((id == INTEL_PCH_P2X_DEVICE_ID_TYPE) ||
> - (id == INTEL_PCH_QEMU_DEVICE_ID_TYPE)) {
> + ((id == INTEL_PCH_QEMU_DEVICE_ID_TYPE) &&
> + pch->subsystem_vendor == 0x1a4f &&
> + pch->subsystem_device == 0x1100)) {
> dev_priv->pch_type = intel_virt_detect_pch(dev);
> } else
> continue;
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: refine qemu south bridge detection
2016-01-25 8:32 ` Jani Nikula
@ 2016-01-25 9:11 ` Bjørn Mork
2016-01-25 11:03 ` Gerd Hoffmann
0 siblings, 1 reply; 4+ messages in thread
From: Bjørn Mork @ 2016-01-25 9:11 UTC (permalink / raw)
To: Jani Nikula
Cc: David Airlie, daniel.vetter, intel-gfx,
open list:INTEL DRM DRIVERS (excluding Poulsbo, Moorestow...), linux-kernel@vger.kernel.org (open list),
Daniel Vetter
Jani Nikula <jani.nikula@linux.intel.com> writes:
> On Mon, 25 Jan 2016, Gerd Hoffmann <kraxel@redhat.com> wrote:
>> The test for the qemu q35 south bridge added by commit
>> "39bfcd52 drm/i915: more virtual south bridge detection"
>> also matches on real hardware. Having the check for
>> virtual systems last in the list is not enough to avoid
>> that ...
>>
>> Refine the check by additionally verifying the pci
>> subsystem id to see whenever it *really* is qemu.
>>
>> Reported-by: Bjørn Mork <bjorn@mork.no>
>> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>
> Already sent the revert in [1], but I'm fine with this if it works for
> Bjørn.
Gerd's fix works fine for me (of course). Tested it now just to be 100%
sure, although it was pretty obvious from the code that it would have
the same effect as an revert on my system.
But I have a feeling Gerd might want to send you a v2 of it in any
case... I was curious about this QEMU subsystem vendor ID, so I went
grepping for it - and found nothing!
|> + pch->subsystem_vendor == 0x1a4f &&
|> + pch->subsystem_device == 0x1100)) {
Looks like a typo:
bjorn@nemi:/usr/local/src/git/qemu$ git grep PCI_SUBVENDOR_ID_REDHAT_QUMRANET
hw/pci/pci.c:static uint16_t pci_default_sub_vendor_id = PCI_SUBVENDOR_ID_REDHAT_QUMRANET;
include/hw/pci/pci.h:#define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4
0x1af4 != 0x1a4f
Thanks a lot both of you for a really fast fix. But it seems Gerd was a
little too fast :)
Bjørn
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: refine qemu south bridge detection
2016-01-25 9:11 ` Bjørn Mork
@ 2016-01-25 11:03 ` Gerd Hoffmann
0 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2016-01-25 11:03 UTC (permalink / raw)
To: Bjørn Mork
Cc: David Airlie, daniel.vetter, intel-gfx,
open list:INTEL DRM DRIVERS (excluding Poulsbo, Moorestow...), linux-kernel@vger.kernel.org (open list),
Daniel Vetter
Hi,
> 0x1af4 != 0x1a4f
Good catch, new patch sent.
thanks,
Gerd
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-25 11:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-25 7:55 [PATCH] drm/i915: refine qemu south bridge detection Gerd Hoffmann
2016-01-25 8:32 ` Jani Nikula
2016-01-25 9:11 ` Bjørn Mork
2016-01-25 11:03 ` Gerd Hoffmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).