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 drm: Simplify async framebuffer child ...



details:   https://anonhg.NetBSD.org/src/rev/2945de40055d
branches:  trunk
changeset: 368554:2945de40055d
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Jul 18 23:34:02 2022 +0000

description:
drm: Simplify async framebuffer child task attachment logic.

No need for scheduling the task to fail.  Nix needless error
branches.

diffstat:

 sys/external/bsd/drm2/amdgpu/amdgpu_pci.c         |   8 +++-----
 sys/external/bsd/drm2/amdgpu/amdgpu_task.h        |   4 ++--
 sys/external/bsd/drm2/amdgpu/amdgpufb.c           |  12 +++---------
 sys/external/bsd/drm2/i915drm/i915_pci.h          |   4 ++--
 sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c |   8 +++-----
 sys/external/bsd/drm2/i915drm/intelfb.c           |  12 +++---------
 sys/external/bsd/drm2/nouveau/nouveau_pci.c       |   8 +++-----
 sys/external/bsd/drm2/nouveau/nouveau_pci.h       |   7 ++++---
 sys/external/bsd/drm2/nouveau/nouveaufb.c         |  12 +++---------
 sys/external/bsd/drm2/radeon/radeon_pci.c         |   8 +++-----
 sys/external/bsd/drm2/radeon/radeon_task.h        |   4 ++--
 sys/external/bsd/drm2/radeon/radeondrmkmsfb.c     |  12 +++---------
 sys/external/bsd/drm2/vmwgfx/vmwgfx_pci.c         |   8 +++-----
 sys/external/bsd/drm2/vmwgfx/vmwgfx_task.h        |   4 ++--
 sys/external/bsd/drm2/vmwgfx/vmwgfxfb.c           |  12 +++---------
 15 files changed, 42 insertions(+), 81 deletions(-)

diffs (truncated from 465 to 300 lines):

diff -r 26c0f69a1196 -r 2945de40055d sys/external/bsd/drm2/amdgpu/amdgpu_pci.c
--- a/sys/external/bsd/drm2/amdgpu/amdgpu_pci.c Mon Jul 18 23:33:53 2022 +0000
+++ b/sys/external/bsd/drm2/amdgpu/amdgpu_pci.c Mon Jul 18 23:34:02 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_pci.c,v 1.10 2021/12/19 12:28:12 riastradh Exp $        */
+/*     $NetBSD: amdgpu_pci.c,v 1.11 2022/07/18 23:34:02 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_pci.c,v 1.10 2021/12/19 12:28:12 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_pci.c,v 1.11 2022/07/18 23:34:02 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/atomic.h>
@@ -290,7 +290,7 @@
        (*task->rt_fn)(task);
 }
 
-int
+void
 amdgpu_task_schedule(device_t self, struct amdgpu_task *task)
 {
        struct amdgpu_softc *const sc = device_private(self);
@@ -299,6 +299,4 @@
                SIMPLEQ_INSERT_TAIL(&sc->sc_tasks, task, rt_u.queue);
        else
                workqueue_enqueue(sc->sc_task_wq, &task->rt_u.work, NULL);
-
-       return 0;
 }
diff -r 26c0f69a1196 -r 2945de40055d sys/external/bsd/drm2/amdgpu/amdgpu_task.h
--- a/sys/external/bsd/drm2/amdgpu/amdgpu_task.h        Mon Jul 18 23:33:53 2022 +0000
+++ b/sys/external/bsd/drm2/amdgpu/amdgpu_task.h        Mon Jul 18 23:34:02 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_task.h,v 1.1 2018/08/27 14:02:32 riastradh Exp $        */
+/*     $NetBSD: amdgpu_task.h,v 1.2 2022/07/18 23:34:02 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -50,6 +50,6 @@
        task->rt_fn = fn;
 }
 
-int    amdgpu_task_schedule(device_t, struct amdgpu_task *);
+void   amdgpu_task_schedule(device_t, struct amdgpu_task *);
 
 #endif /* _AMDGPU_AMDGPU_TASK_H_ */
diff -r 26c0f69a1196 -r 2945de40055d sys/external/bsd/drm2/amdgpu/amdgpufb.c
--- a/sys/external/bsd/drm2/amdgpu/amdgpufb.c   Mon Jul 18 23:33:53 2022 +0000
+++ b/sys/external/bsd/drm2/amdgpu/amdgpufb.c   Mon Jul 18 23:34:02 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpufb.c,v 1.4 2022/07/18 23:33:53 riastradh Exp $   */
+/*     $NetBSD: amdgpufb.c,v 1.5 2022/07/18 23:34:02 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpufb.c,v 1.4 2022/07/18 23:33:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpufb.c,v 1.5 2022/07/18 23:34:02 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/bus.h>
@@ -83,7 +83,6 @@
 {
        struct amdgpufb_softc *const sc = device_private(self);
        const struct amdgpufb_attach_args *const afa = aux;
-       int error;
 
        sc->sc_dev = self;
        sc->sc_afa = *afa;
@@ -93,12 +92,7 @@
        aprint_normal("\n");
 
        amdgpu_task_init(&sc->sc_attach_task, &amdgpufb_attach_task);
-       error = amdgpu_task_schedule(parent, &sc->sc_attach_task);
-       if (error) {
-               aprint_error_dev(self, "failed to schedule mode set: %d\n",
-                   error);
-               return;
-       }
+       amdgpu_task_schedule(parent, &sc->sc_attach_task);
        config_pending_incr(self);
 }
 
diff -r 26c0f69a1196 -r 2945de40055d sys/external/bsd/drm2/i915drm/i915_pci.h
--- a/sys/external/bsd/drm2/i915drm/i915_pci.h  Mon Jul 18 23:33:53 2022 +0000
+++ b/sys/external/bsd/drm2/i915drm/i915_pci.h  Mon Jul 18 23:34:02 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_pci.h,v 1.1 2014/07/24 21:18:40 riastradh Exp $   */
+/*     $NetBSD: i915_pci.h,v 1.2 2022/07/18 23:34:02 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -51,6 +51,6 @@
        task->ift_fn = fn;
 }
 
-int    i915drmkms_task_schedule(device_t, struct i915drmkms_task *);
+void   i915drmkms_task_schedule(device_t, struct i915drmkms_task *);
 
 #endif /* _I915DRM_I915_PCI_H_ */
diff -r 26c0f69a1196 -r 2945de40055d sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c
--- a/sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c Mon Jul 18 23:33:53 2022 +0000
+++ b/sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c Mon Jul 18 23:34:02 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_pci_autoconf.c,v 1.11 2021/12/20 14:52:25 riastradh Exp $ */
+/*     $NetBSD: i915_pci_autoconf.c,v 1.12 2022/07/18 23:34: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.11 2021/12/20 14:52:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_pci_autoconf.c,v 1.12 2022/07/18 23:34:02 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/atomic.h>
@@ -291,7 +291,7 @@
        (*task->ift_fn)(task);
 }
 
-int
+void
 i915drmkms_task_schedule(device_t self, struct i915drmkms_task *task)
 {
        struct i915drmkms_softc *const sc = device_private(self);
@@ -300,6 +300,4 @@
                SIMPLEQ_INSERT_TAIL(&sc->sc_tasks, task, ift_u.queue);
        else
                workqueue_enqueue(sc->sc_task_wq, &task->ift_u.work, NULL);
-
-       return 0;
 }
diff -r 26c0f69a1196 -r 2945de40055d sys/external/bsd/drm2/i915drm/intelfb.c
--- a/sys/external/bsd/drm2/i915drm/intelfb.c   Mon Jul 18 23:33:53 2022 +0000
+++ b/sys/external/bsd/drm2/i915drm/intelfb.c   Mon Jul 18 23:34:02 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intelfb.c,v 1.23 2022/07/18 23:33:53 riastradh Exp $   */
+/*     $NetBSD: intelfb.c,v 1.24 2022/07/18 23:34:02 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intelfb.c,v 1.23 2022/07/18 23:33:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intelfb.c,v 1.24 2022/07/18 23:34:02 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/bus.h>
@@ -90,7 +90,6 @@
 {
        struct intelfb_softc *const sc = device_private(self);
        const struct intelfb_attach_args *const ifa = aux;
-       int error;
 
        sc->sc_dev = self;
        sc->sc_ifa = *ifa;
@@ -100,12 +99,7 @@
        aprint_normal("\n");
 
        i915drmkms_task_init(&sc->sc_attach_task, &intelfb_attach_task);
-       error = i915drmkms_task_schedule(parent, &sc->sc_attach_task);
-       if (error) {
-               aprint_error_dev(self, "failed to schedule mode set: %d\n",
-                   error);
-               return;
-       }
+       i915drmkms_task_schedule(parent, &sc->sc_attach_task);
        config_pending_incr(self);
 }
 
diff -r 26c0f69a1196 -r 2945de40055d sys/external/bsd/drm2/nouveau/nouveau_pci.c
--- a/sys/external/bsd/drm2/nouveau/nouveau_pci.c       Mon Jul 18 23:33:53 2022 +0000
+++ b/sys/external/bsd/drm2/nouveau/nouveau_pci.c       Mon Jul 18 23:34:02 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_pci.c,v 1.35 2021/12/19 12:45:35 riastradh Exp $       */
+/*     $NetBSD: nouveau_pci.c,v 1.36 2022/07/18 23:34:02 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.35 2021/12/19 12:45:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.36 2022/07/18 23:34:02 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #if defined(__arm__) || defined(__aarch64__)
@@ -313,7 +313,7 @@
        (*task->nt_fn)(task);
 }
 
-int
+void
 nouveau_pci_task_schedule(device_t self, struct nouveau_pci_task *task)
 {
        struct nouveau_pci_softc *const sc = device_private(self);
@@ -322,8 +322,6 @@
                SIMPLEQ_INSERT_TAIL(&sc->sc_tasks, task, nt_u.queue);
        else
                workqueue_enqueue(sc->sc_task_wq, &task->nt_u.work, NULL);
-
-       return 0;
 }
 
 extern struct drm_driver *const nouveau_drm_driver_stub; /* XXX */
diff -r 26c0f69a1196 -r 2945de40055d sys/external/bsd/drm2/nouveau/nouveau_pci.h
--- a/sys/external/bsd/drm2/nouveau/nouveau_pci.h       Mon Jul 18 23:33:53 2022 +0000
+++ b/sys/external/bsd/drm2/nouveau/nouveau_pci.h       Mon Jul 18 23:34:02 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_pci.h,v 1.2 2015/10/17 12:02:44 jmcneill Exp $ */
+/*     $NetBSD: nouveau_pci.h,v 1.3 2022/07/18 23:34:02 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -44,12 +44,13 @@
 };
 
 static inline void
-nouveau_pci_task_init(struct nouveau_pci_task *task, void (*fn)(struct nouveau_pci_task *))
+nouveau_pci_task_init(struct nouveau_pci_task *task,
+    void (*fn)(struct nouveau_pci_task *))
 {
 
        task->nt_fn = fn;
 }
 
-int    nouveau_pci_task_schedule(device_t, struct nouveau_pci_task *);
+void   nouveau_pci_task_schedule(device_t, struct nouveau_pci_task *);
 
 #endif /* _NOUVEAU_NOUVEAU_PCI_H_ */
diff -r 26c0f69a1196 -r 2945de40055d sys/external/bsd/drm2/nouveau/nouveaufb.c
--- a/sys/external/bsd/drm2/nouveau/nouveaufb.c Mon Jul 18 23:33:53 2022 +0000
+++ b/sys/external/bsd/drm2/nouveau/nouveaufb.c Mon Jul 18 23:34:02 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveaufb.c,v 1.8 2022/07/18 23:33:53 riastradh Exp $  */
+/*     $NetBSD: nouveaufb.c,v 1.9 2022/07/18 23:34:02 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveaufb.c,v 1.8 2022/07/18 23:33:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveaufb.c,v 1.9 2022/07/18 23:34:02 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/bus.h>
@@ -88,7 +88,6 @@
 {
        struct nouveaufb_softc *const sc = device_private(self);
        const struct nouveaufb_attach_args *const nfa = aux;
-       int error;
 
        sc->sc_dev = self;
        sc->sc_nfa = *nfa;
@@ -98,12 +97,7 @@
        aprint_normal("\n");
 
        nouveau_pci_task_init(&sc->sc_attach_task, &nouveaufb_attach_task);
-       error = nouveau_pci_task_schedule(parent, &sc->sc_attach_task);
-       if (error) {
-               aprint_error_dev(self, "failed to schedule mode set: %d\n",
-                   error);
-               return;
-       }
+       nouveau_pci_task_schedule(parent, &sc->sc_attach_task);
        config_pending_incr(self);
 }
 
diff -r 26c0f69a1196 -r 2945de40055d sys/external/bsd/drm2/radeon/radeon_pci.c
--- a/sys/external/bsd/drm2/radeon/radeon_pci.c Mon Jul 18 23:33:53 2022 +0000
+++ b/sys/external/bsd/drm2/radeon/radeon_pci.c Mon Jul 18 23:34:02 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeon_pci.c,v 1.20 2021/12/19 12:28:12 riastradh Exp $        */
+/*     $NetBSD: radeon_pci.c,v 1.21 2022/07/18 23:34:03 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_pci.c,v 1.20 2021/12/19 12:28:12 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_pci.c,v 1.21 2022/07/18 23:34:03 riastradh Exp $");
 
 #ifdef _KERNEL_OPT



Home | Main Index | Thread Index | Old Index