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 Patch up drm_atomic_helper.c.



details:   https://anonhg.NetBSD.org/src/rev/5de37438857b
branches:  trunk
changeset: 365811:5de37438857b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 06:50:45 2018 +0000

description:
Patch up drm_atomic_helper.c.

- Mark unused variables as such.
  . Mistakes in local patches are likely to lead to unused variables,
    so keep this warning enabled.
- Build with -Wno-shadow.
  . Local patches aren't likely to cause this, so just suppress it.
- static plane_crtc_active

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_atomic_helper.c |  23 +++++++++++++++------
 sys/external/bsd/drm2/drm/files.drmkms             |   3 +-
 2 files changed, 18 insertions(+), 8 deletions(-)

diffs (94 lines):

diff -r 32dc2c76bb7b -r 5de37438857b sys/external/bsd/drm2/dist/drm/drm_atomic_helper.c
--- a/sys/external/bsd/drm2/dist/drm/drm_atomic_helper.c        Mon Aug 27 06:50:20 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_atomic_helper.c        Mon Aug 27 06:50:45 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_atomic_helper.c,v 1.3 2018/08/27 06:48:40 riastradh Exp $  */
+/*     $NetBSD: drm_atomic_helper.c,v 1.4 2018/08/27 06:50:45 riastradh Exp $  */
 
 /*
  * Copyright (C) 2014 Red Hat
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_atomic_helper.c,v 1.3 2018/08/27 06:48:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_atomic_helper.c,v 1.4 2018/08/27 06:50:45 riastradh Exp $");
 
 #include <drm/drmP.h>
 #include <drm/drm_atomic.h>
@@ -385,7 +385,7 @@
        struct drm_crtc *crtc;
        struct drm_crtc_state *crtc_state;
        struct drm_connector *connector;
-       struct drm_connector_state *connector_state;
+       struct drm_connector_state *connector_state __unused;
        int i, ret;
 
        for_each_crtc_in_state(state, crtc, crtc_state, i) {
@@ -741,7 +741,7 @@
        struct drm_crtc *crtc;
        struct drm_crtc_state *old_crtc_state;
        struct drm_connector *connector;
-       struct drm_connector_state *old_conn_state;
+       struct drm_connector_state *old_conn_state __unused;
        int i;
 
        for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) {
@@ -835,9 +835,9 @@
                                              struct drm_atomic_state *old_state)
 {
        struct drm_crtc *crtc;
-       struct drm_crtc_state *old_crtc_state;
+       struct drm_crtc_state *old_crtc_state __unused;
        struct drm_connector *connector;
-       struct drm_connector_state *old_conn_state;
+       struct drm_connector_state *old_conn_state __unused;
        int i;
 
        for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) {
@@ -983,10 +983,19 @@
                if (!old_crtc_state->enable)
                        continue;
 
+#ifdef __NetBSD__
+               spin_lock(&dev->vbl_lock);
+               DRM_SPIN_WAIT_ON(ret, &dev->vblank[i].queue, &dev->vbl_lock,
+                   msecs_to_jiffies(50),
+                   (old_crtc_state->last_vblank_count !=
+                       drm_crtc_vblank_count(crtc)));
+               spin_unlock(&dev->vbl_lock);
+#else
                ret = wait_event_timeout(dev->vblank[i].queue,
                                old_crtc_state->last_vblank_count !=
                                        drm_crtc_vblank_count(crtc),
                                msecs_to_jiffies(50));
+#endif
 
                drm_crtc_vblank_put(crtc);
        }
@@ -1172,7 +1181,7 @@
 }
 EXPORT_SYMBOL(drm_atomic_helper_prepare_planes);
 
-bool plane_crtc_active(struct drm_plane_state *state)
+static bool plane_crtc_active(struct drm_plane_state *state)
 {
        return state->crtc && state->crtc->state->active;
 }
diff -r 32dc2c76bb7b -r 5de37438857b sys/external/bsd/drm2/drm/files.drmkms
--- a/sys/external/bsd/drm2/drm/files.drmkms    Mon Aug 27 06:50:20 2018 +0000
+++ b/sys/external/bsd/drm2/drm/files.drmkms    Mon Aug 27 06:50:45 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.drmkms,v 1.22 2018/08/27 06:47:51 riastradh Exp $
+#      $NetBSD: files.drmkms,v 1.23 2018/08/27 06:50:45 riastradh Exp $
 
 include "external/bsd/drm2/linux/files.drmkms_linux"
 
@@ -24,6 +24,7 @@
 # under dist/include/uapi rather than dist/uapi.)
 makeoptions    drmkms  CPPFLAGS+="-I$S/external/bsd/drm2/dist"
 
+makeoptions    drmkms  "CWARNFLAGS.drm_atomic_helper.c"+="-Wno-shadow"
 makeoptions    drmkms  "CWARNFLAGS.drm_crtc.c"+="-Wno-shadow"
 makeoptions    drmkms  "CWARNFLAGS.drm_crtc.c"+="-Wno-missing-field-initializers"
 makeoptions    drmkms  "CWARNFLAGS.drm_edid.c"+="-Wno-shadow"



Home | Main Index | Thread Index | Old Index