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 drm: Simplify use of drm API for d...



details:   https://anonhg.NetBSD.org/src/rev/608b989e9f49
branches:  trunk
changeset: 1029052:608b989e9f49
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Dec 20 00:27:53 2021 +0000

description:
drm: Simplify use of drm API for display on/off logic in drmfb.

diffstat:

 sys/external/bsd/drm2/drm/drmfb.c |  19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diffs (48 lines):

diff -r 4d636a5ecdd6 -r 608b989e9f49 sys/external/bsd/drm2/drm/drmfb.c
--- a/sys/external/bsd/drm2/drm/drmfb.c Mon Dec 20 00:27:42 2021 +0000
+++ b/sys/external/bsd/drm2/drm/drmfb.c Mon Dec 20 00:27:53 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drmfb.c,v 1.10 2021/12/19 10:32:59 riastradh Exp $     */
+/*     $NetBSD: drmfb.c,v 1.11 2021/12/20 00:27:53 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drmfb.c,v 1.10 2021/12/19 10:32:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drmfb.c,v 1.11 2021/12/20 00:27:53 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "vga.h"
@@ -196,8 +196,6 @@
        struct genfb_softc *const genfb = v;
        struct drmfb_softc *const sc = container_of(genfb, struct drmfb_softc,
            sc_genfb);
-       struct drm_connector_list_iter conn_iter;
-       struct drm_connector *connector;
        int error;
 
        if (sc->sc_da.da_params->dp_ioctl) {
@@ -227,17 +225,10 @@
                const int on = *(const int *)data;
                const int dpms_mode = on? DRM_MODE_DPMS_ON : DRM_MODE_DPMS_OFF;
                struct drm_fb_helper *const fb_helper = sc->sc_da.da_fb_helper;
-               struct drm_device *const dev = fb_helper->dev;
 
-               drm_modeset_lock_all(dev);
-               drm_connector_list_iter_begin(fb_helper->dev, &conn_iter);
-               drm_client_for_each_connector_iter(connector, &conn_iter) {
-                       (*connector->funcs->dpms)(connector, dpms_mode);
-                       drm_object_property_set_value(&connector->base,
-                           dev->mode_config.dpms_property, dpms_mode);
-               }
-               drm_connector_list_iter_end(&conn_iter);
-               drm_modeset_unlock_all(dev);
+               mutex_lock(&fb_helper->lock);
+               drm_client_modeset_dpms(&fb_helper->client, dpms_mode);
+               mutex_unlock(&fb_helper->lock);
 
                return 0;
        }



Home | Main Index | Thread Index | Old Index