diff options
| author | riastradh <riastradh@NetBSD.org> | 2021-12-19 11:00:46 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2021-12-19 11:00:46 +0000 |
| commit | c7fa00ede9130ca6b91d5031264c7bb7047e1a71 (patch) | |
| tree | d2345e3f854e0849c0a548a3fce72e81337d1829 /sys/dev/i2c | |
| parent | 1fa733e6ffebe649ce7c7521fc5765b9206be34d (diff) | |
Get drm to build on arm64 again.
Author: Jared McNeill <jmcneill@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
Diffstat (limited to 'sys/dev/i2c')
| -rw-r--r-- | sys/dev/i2c/anxedp.c | 43 |
1 files changed, 11 insertions, 32 deletions
diff --git a/sys/dev/i2c/anxedp.c b/sys/dev/i2c/anxedp.c index 3ad796e9109..2c1049ef813 100644 --- a/sys/dev/i2c/anxedp.c +++ b/sys/dev/i2c/anxedp.c @@ -1,4 +1,4 @@ -/* $NetBSD: anxedp.c,v 1.6 2021/01/27 02:29:48 thorpej Exp $ */ +/* $NetBSD: anxedp.c,v 1.7 2021/12/19 11:00:47 riastradh Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: anxedp.c,v 1.6 2021/01/27 02:29:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: anxedp.c,v 1.7 2021/12/19 11:00:47 riastradh Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -48,10 +48,12 @@ __KERNEL_RCSID(0, "$NetBSD: anxedp.c,v 1.6 2021/01/27 02:29:48 thorpej Exp $"); #include <dev/fdt/fdtvar.h> #include <dev/fdt/fdt_port.h> -#include <drm/drmP.h> +#include <drm/drm_drv.h> +#include <drm/drm_connector.h> #include <drm/drm_crtc.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_edid.h> +#include <drm/drm_probe_helper.h> #define ANX_DP_AUX_CH_CTL_1 0xe5 #define ANX_AUX_LENGTH __BITS(7,4) @@ -253,37 +255,15 @@ anxedp_connector_get_modes(struct drm_connector *connector) if (error == 0) pedid = (struct edid *)edid; - drm_mode_connector_update_edid_property(connector, pedid); + drm_connector_update_edid_property(connector, pedid); if (pedid == NULL) return 0; - error = drm_add_edid_modes(connector, pedid); - drm_edid_to_eld(connector, pedid); - - return error; -} - -static struct drm_encoder * -anxedp_connector_best_encoder(struct drm_connector *connector) -{ - int enc_id = connector->encoder_ids[0]; - struct drm_mode_object *obj; - struct drm_encoder *encoder = NULL; - - if (enc_id) { - obj = drm_mode_object_find(connector->dev, enc_id, - DRM_MODE_OBJECT_ENCODER); - if (obj == NULL) - return NULL; - encoder = obj_to_encoder(obj); - } - - return encoder; + return drm_add_edid_modes(connector, pedid); } static const struct drm_connector_helper_funcs anxedp_connector_helper_funcs = { .get_modes = anxedp_connector_get_modes, - .best_encoder = anxedp_connector_best_encoder, }; static int @@ -304,7 +284,7 @@ anxedp_bridge_attach(struct drm_bridge *bridge) connector->connector_type); drm_connector_helper_add(connector, &anxedp_connector_helper_funcs); - error = drm_mode_connector_attach_encoder(connector, bridge->encoder); + error = drm_connector_attach_encoder(connector, bridge->encoder); if (error != 0) return error; @@ -333,7 +313,8 @@ anxedp_bridge_post_disable(struct drm_bridge *bridge) static void anxedp_bridge_mode_set(struct drm_bridge *bridge, - struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) { struct anxedp_softc * const sc = bridge->driver_private; @@ -394,12 +375,10 @@ anxedp_ep_activate(device_t dev, struct fdt_endpoint *ep, bool activate) sc->sc_bridge.funcs = &anxedp_bridge_funcs; sc->sc_bridge.encoder = encoder; - error = drm_bridge_attach(encoder->dev, &sc->sc_bridge); + error = drm_bridge_attach(encoder, &sc->sc_bridge, NULL); if (error != 0) return EIO; - encoder->bridge = &sc->sc_bridge; - return 0; } |
