Displaying 20 results from an estimated 94 matches for "pci_class_display_vga".
2023 Aug 25
7
[PATCH 0/5] Add the pci_get_base_class() helper and use it
From: Sui Jingfeng <suijingfeng at loongson.cn>
There is no function that can be used to get all PCI(e) devices in a
system by matching against its the PCI base class code only, while keep
the sub-class code and the programming interface ignored. Therefore, add
the pci_get_base_class() function to suit the need.
For example, if an application want to process all PCI(e) display devices
in a
2023 Aug 25
1
[PATCH 2/5] ALSA: hda/intel: Use pci_get_base_class() to reduce duplicated code
...d/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index a21b61ad08d1..811a149584f2 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1429,17 +1429,11 @@ static bool atpx_present(void)
acpi_handle dhandle, atpx_handle;
acpi_status status;
- while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
- dhandle = ACPI_HANDLE(&pdev->dev);
- if (dhandle) {
- status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
- if (ACPI_SUCCESS(status)) {
- pci_dev_put(pdev);
- return true;
- }
- }
- }
- while ((pdev = pci_get_class(PCI_CLASS_D...
2016 May 19
2
[PATCH v4] vga_switcheroo: Add helper for deferred probing
...a MacBook Pros and an
additional check is expected to be needed for retinas.)
v2: This helper could eventually be used by audio clients as well,
so rephrase kerneldoc to refer to "client" instead of "GPU"
and move the single existing check in an if block specific
to PCI_CLASS_DISPLAY_VGA devices. Move documentation on
that check from kerneldoc to a comment. (Daniel Vetter)
v3: Mandate in kerneldoc that registration of client shall only
happen after calling this helper. (Daniel Vetter)
v4: Rebase on 412c8f7de011 ("drm/radeon: Return -EPROBE_DEFER when
amdkfd not l...
2020 Nov 24
1
[PATCH 09/15] drm/nouveau: Remove references to struct drm_device.pdev
...hy dev_is_pci() is needed here.
So I am obviously missing something :-(
> return 0;
>
> out_unlock:
> @@ -548,7 +550,7 @@ nouveau_fbcon_init(struct drm_device *dev)
> int ret;
>
> if (!dev->mode_config.num_crtc ||
> - (dev->pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
> + (to_pci_dev(dev->dev)->class >> 8) != PCI_CLASS_DISPLAY_VGA)
> return 0;
>
> fbcon = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL);
> diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c
> index c85dd8afa3c3..7c...
2023 Jun 08
6
[PATCH v3 0/4] PCI/VGA: introduce is_boot_device function callback to vga_client_register
From: Sui Jingfeng <suijingfeng at loongson.cn>
Patch 1,2 and 3 do basic clean up to the vgaarb module.
Patch 4 introduce is_boot_device function callback to vga_client_register
Sui Jingfeng (4):
PCI/VGA: tidy up the code and comment format
PCI/VGA: Use unsigned type for the io_state variable
PCI/VGA: only deal with VGA class devices
PCI/VGA: introduce is_boot_device function
2023 Aug 25
0
[PATCH 5/5] drm/radeon: Use pci_get_base_class() to reduce duplicated code
...index 63bdc9f6fc24..3a8c5199a0fe 100644
--- a/drivers/gpu/drm/radeon/radeon_bios.c
+++ b/drivers/gpu/drm/radeon/radeon_bios.c
@@ -199,7 +199,11 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev)
if (rdev->flags & RADEON_IS_IGP)
return false;
- while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
+ while ((pdev = pci_get_base_class(PCI_BASE_CLASS_DISPLAY, pdev))) {
+ if ((pdev->class != PCI_CLASS_DISPLAY_VGA << 8) &&
+ (pdev->class != PCI_CLASS_DISPLAY_OTHER << 8))
+ continue;
+
dhandle = ACPI_HANDLE(&pdev->dev);
i...
2015 Mar 25
2
[PATCH] Add virtio gpu driver.
...ci_common.c
> > @@ -510,7 +510,7 @@ static int virtio_pci_probe(struct pci_dev *pci_dev,
> > goto err_enable_device;
> >
> > rc = pci_request_regions(pci_dev, "virtio-pci");
> > - if (rc)
> > + if (rc && ((pci_dev->class >> 8) != PCI_CLASS_DISPLAY_VGA))
> > goto err_request_regions;
> >
> > if (force_legacy) {
>
> This is probably what you described as "the only concern?
Ahem, no, forgot that one, but it is related. With vesafb using and
registering the vga compat framebuffer bar pci_request_regions will no...
2015 Mar 25
2
[PATCH] Add virtio gpu driver.
...ci_common.c
> > @@ -510,7 +510,7 @@ static int virtio_pci_probe(struct pci_dev *pci_dev,
> > goto err_enable_device;
> >
> > rc = pci_request_regions(pci_dev, "virtio-pci");
> > - if (rc)
> > + if (rc && ((pci_dev->class >> 8) != PCI_CLASS_DISPLAY_VGA))
> > goto err_request_regions;
> >
> > if (force_legacy) {
>
> This is probably what you described as "the only concern?
Ahem, no, forgot that one, but it is related. With vesafb using and
registering the vga compat framebuffer bar pci_request_regions will no...
2017 Nov 10
2
[PATCH] Accept 3d controllers and not only VGA controllers.
...74a9d82 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -498,8 +498,7 @@ nouveau_fbcon_init(struct drm_device *dev)
int preferred_bpp;
int ret;
- if (!dev->mode_config.num_crtc ||
- (dev->pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
+ if (!dev->mode_config.num_crtc)
return 0;
fbcon = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL);
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c
b/drivers/gpu/drm/nouveau/nv50_display.c
index fb47d46050ec..061daf036407 100644
--- a/drivers/gpu/drm/nouveau/nv50_displ...
2015 Apr 01
2
[PATCH v2 4/4] Add virtio-vga bits.
...(strcmp(vdev->dev.parent->bus->name, "pci") == 0)
- dev->pdev = to_pci_dev(vdev->dev.parent);
+ if (strcmp(vdev->dev.parent->bus->name, "pci") == 0) {
+ struct pci_dev *pdev = to_pci_dev(vdev->dev.parent);
+ bool vga = (pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA;
+
+ DRM_INFO("pci: %s detected\n",
+ vga ? "virtio-vga" : "virtio-gpu-pci");
+ dev->pdev = pdev;
+ if (vga)
+ virtio_pci_kick_out_firmware_fb(pdev);
+ }
ret = drm_dev_register(dev, 0);
if (ret)
diff --git a/drivers/virtio/virtio_pci_common.c b/drivers...
2015 Apr 01
2
[PATCH v2 4/4] Add virtio-vga bits.
...(strcmp(vdev->dev.parent->bus->name, "pci") == 0)
- dev->pdev = to_pci_dev(vdev->dev.parent);
+ if (strcmp(vdev->dev.parent->bus->name, "pci") == 0) {
+ struct pci_dev *pdev = to_pci_dev(vdev->dev.parent);
+ bool vga = (pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA;
+
+ DRM_INFO("pci: %s detected\n",
+ vga ? "virtio-vga" : "virtio-gpu-pci");
+ dev->pdev = pdev;
+ if (vga)
+ virtio_pci_kick_out_firmware_fb(pdev);
+ }
ret = drm_dev_register(dev, 0);
if (ret)
diff --git a/drivers/virtio/virtio_pci_common.c b/drivers...
2017 Dec 03
2
[PATCH] Accept 3d controllers and not only VGA controllers.
...on.c
>> +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
>> @@ -498,8 +498,7 @@ nouveau_fbcon_init(struct drm_device *dev)
>> int preferred_bpp;
>> int ret;
>> - if (!dev->mode_config.num_crtc ||
>> - (dev->pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
>> + if (!dev->mode_config.num_crtc)
>> return 0;
>> fbcon = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL);
>> diff --git a/drivers/gpu/drm/nouveau/nv50_display.c
>> b/drivers/gpu/drm/nouveau/nv50_display.c
>> index fb47d46050ec..061d...
2016 May 21
1
[PATCH v4] vga_switcheroo: Add helper for deferred probing
Hi Emil,
On Fri, May 20, 2016 at 12:41:04AM +0100, Emil Velikov wrote:
> On 19 May 2016 at 15:39, Lukas Wunner <lukas at wunner.de> wrote:
> > +bool vga_switcheroo_client_probe_defer(struct pci_dev *pdev)
> > +{
> > + if ((pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA) {
> Not sure if we want/need this, yet at least. This changes behaviour
> which is not what refactoring patches should be doing, right ? if
> needed it ought to be a separate patch, imho.
Well, the commit message doesn't claim "no functional change", does it?
Daniel Vetter...
2019 Aug 05
1
[PATCH v2] drm/qxl: get vga ioports
...-- a/drivers/gpu/drm/qxl/qxl_drv.c
+++ b/drivers/gpu/drm/qxl/qxl_drv.c
@@ -63,6 +63,11 @@ module_param_named(num_heads, qxl_num_crtc, int, 0400);
static struct drm_driver qxl_driver;
static struct pci_driver qxl_pci_driver;
+static bool is_vga(struct pci_dev *pdev)
+{
+ return pdev->class == PCI_CLASS_DISPLAY_VGA << 8;
+}
+
static int
qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
@@ -87,9 +92,17 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (ret)
goto disable_pci;
+ if (is_vga(pdev)) {
+ ret = vga_get_interruptible(pdev, VGA_RSRC_LEGACY_...
2016 May 31
2
[PATCH v6 1/2] vga_switcheroo: Add helper for deferred probing
...as the AMD GPUs
built into MacBook Pros are only supported by radeon so far.
v2: This helper could eventually be used by audio clients as well,
so rephrase kerneldoc to refer to "client" instead of "GPU"
and move the single existing check in an if block specific
to PCI_CLASS_DISPLAY_VGA devices. Move documentation on
that check from kerneldoc to a comment. (Daniel Vetter)
v3: Mandate in kerneldoc that registration of client shall only
happen after calling this helper. (Daniel Vetter)
v4: Rebase on 412c8f7de011 ("drm/radeon: Return -EPROBE_DEFER when
amdkfd not l...
2017 Dec 14
2
[PATCH] Accept 3d controllers and not only VGA controllers.
.../nouveau_fbcon.c
>>>> @@ -498,8 +498,7 @@ nouveau_fbcon_init(struct drm_device *dev)
>>>> int preferred_bpp;
>>>> int ret;
>>>> - if (!dev->mode_config.num_crtc ||
>>>> - (dev->pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
>>>> + if (!dev->mode_config.num_crtc)
>>>> return 0;
>>>> fbcon = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL);
>>>> diff --git a/drivers/gpu/drm/nouveau/nv50_display.c
>>>> b/drivers/gpu/drm/nouveau/nv50_d...
2016 May 14
1
[PATCH] drm/nouveau: check function before using it
...ffer = {sizeof(acpi_method_name), acpi_method_name};
struct pci_dev *pdev = NULL;
int has_dsm = 0;
- int has_optimus = 0;
+ uint32_t optimus_funcs = 0;
int vga_count = 0;
bool guid_valid;
int retval;
@@ -268,30 +270,28 @@ static bool nouveau_dsm_detect(void)
while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
vga_count++;
- retval = nouveau_dsm_pci_probe(pdev);
+ retval = nouveau_dsm_pci_probe(pdev, &optimus_funcs);
if (retval & NOUVEAU_DSM_HAS_MUX)
has_dsm |= 1;
- if (retval & NOUVEAU_DSM_HAS_OPT)
- has_optimus = 1;
}
while ((pdev = pci_g...
2019 Oct 17
4
[PATCH v4] pci: prevent putting nvidia GPUs into lower device states on certain intel bridges
...ers/pci/quirks.c b/drivers/pci/quirks.c
index 44c4ae1abd00..0006c9e37b6f 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5268,3 +5268,56 @@ static void quirk_reset_lenovo_thinkpad_p50_nvgpu(struct pci_dev *pdev)
DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_NVIDIA, 0x13b1,
PCI_CLASS_DISPLAY_VGA, 8,
quirk_reset_lenovo_thinkpad_p50_nvgpu);
+
+/*
+ * Some Intel PCIe bridges cause devices to disappear from the PCIe bus after
+ * those were put into D3cold state if they were put into a non D0 PCI PM
+ * device state before doing so.
+ *
+ * This leads to various issue different issue...
2019 Oct 16
4
[PATCH v3] pci: prevent putting nvidia GPUs into lower device states on certain intel bridges
...ers/pci/quirks.c b/drivers/pci/quirks.c
index 44c4ae1abd00..c2f20b745dd4 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5268,3 +5268,55 @@ static void quirk_reset_lenovo_thinkpad_p50_nvgpu(struct pci_dev *pdev)
DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_NVIDIA, 0x13b1,
PCI_CLASS_DISPLAY_VGA, 8,
quirk_reset_lenovo_thinkpad_p50_nvgpu);
+
+/*
+ * Some Intel PCIe bridges cause devices to disappear from the PCIe bus after
+ * those were put into D3cold state if they were put into a non D0 PCI PM
+ * device state before doing so.
+ *
+ * This leads to various issue different issue...
2017 Dec 18
2
[PATCH] Accept 3d controllers and not only VGA controllers.
...; @@ -498,8 +498,7 @@ nouveau_fbcon_init(struct drm_device *dev)
>>>>>> int preferred_bpp;
>>>>>> int ret;
>>>>>> - if (!dev->mode_config.num_crtc ||
>>>>>> - (dev->pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
>>>>>> + if (!dev->mode_config.num_crtc)
>>>>>> return 0;
>>>>>> fbcon = kzalloc(sizeof(struct nouveau_fbdev),
>> GFP_KERNEL);
>>>>>> diff --git a/drivers/gpu/drm/nouveau/nv50_display.c
>>...