Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/i915drm Return pci_device_t from match...



details:   https://anonhg.NetBSD.org/src/rev/321c8dddb162
branches:  trunk
changeset: 1028731:321c8dddb162
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:53:02 2021 +0000

description:
Return pci_device_t from match so we can call i915_driver_probe


Author: Maya Rashish <maya%NetBSD.org@localhost>
Committer: Taylor R Campbell <riastradh%NetBSD.org@localhost>

diffstat:

 sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c |  21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diffs (76 lines):

diff -r c973b08f499c -r 321c8dddb162 sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c
--- a/sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c Sun Dec 19 11:52:55 2021 +0000
+++ b/sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c Sun Dec 19 11:53:02 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_pci_autoconf.c,v 1.5 2021/12/19 11:33:49 riastradh Exp $  */
+/*     $NetBSD: i915_pci_autoconf.c,v 1.6 2021/12/19 11:53:02 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_pci_autoconf.c,v 1.5 2021/12/19 11:33:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_pci_autoconf.c,v 1.6 2021/12/19 11:53:02 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/queue.h>
@@ -64,7 +64,7 @@
        bool                            sc_dev_registered;
 };
 
-static const struct intel_device_info *
+static const struct pci_device_id *
                i915drmkms_pci_lookup(const struct pci_attach_args *);
 
 static int     i915drmkms_match(device_t, cfdata_t, void *);
@@ -85,7 +85,7 @@
 extern const struct pci_device_id *const i915_device_ids;
 extern const size_t i915_n_device_ids;
 
-static const struct intel_device_info *
+static const struct pci_device_id *
 i915drmkms_pci_lookup(const struct pci_attach_args *pa)
 {
        size_t i;
@@ -110,15 +110,15 @@
        if (i == i915_n_device_ids)
                return NULL;
 
-       const struct intel_device_info *const info =
-           (const void *)(uintptr_t)i915_device_ids[i].driver_data;
+       const struct pci_device_id *ent = &i915_device_ids[i];
+       const struct intel_device_info *const info = (struct intel_device_info *) ent->driver_data;
 
        if (info->require_force_probe) {
                printf("i915drmkms: preliminary hardware support disabled\n");
                return NULL;
        }
 
-       return info;
+       return ent;
 }
 
 static int
@@ -168,9 +168,8 @@
 {
        struct i915drmkms_softc *const sc = device_private(self);
        struct pci_attach_args *const pa = &sc->sc_pa;
-       const struct intel_device_info *const info = i915drmkms_pci_lookup(pa);
-       const unsigned long cookie =
-           (unsigned long)(uintptr_t)(const void *)info;
+       const struct pci_device_id *ent = i915drmkms_pci_lookup(pa);
+       const struct intel_device_info *const info = (struct intel_device_info *) ent->driver_data;
        int error;
 
        KASSERT(info != NULL);
@@ -198,7 +197,7 @@
        sc->sc_pci_attached = true;
 
        /* XXX errno Linux->NetBSD */
-       error = -drm_dev_register(sc->sc_drm_dev, cookie);
+       error = -i915_driver_probe(&sc->sc_pci_dev, ent);
        if (error) {
                aprint_error_dev(self, "unable to register drm: %d\n", error);
                return;



Home | Main Index | Thread Index | Old Index