summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2021-12-19 11:00:46 +0000
committerriastradh <riastradh@NetBSD.org>2021-12-19 11:00:46 +0000
commitc7fa00ede9130ca6b91d5031264c7bb7047e1a71 (patch)
treed2345e3f854e0849c0a548a3fce72e81337d1829 /sys/dev
parent1fa733e6ffebe649ce7c7521fc5765b9206be34d (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')
-rw-r--r--sys/dev/fdt/fdt_panel.c8
-rw-r--r--sys/dev/fdt/hdmi_connector.c35
-rw-r--r--sys/dev/i2c/anxedp.c43
-rw-r--r--sys/dev/ic/anx_dp.c83
-rw-r--r--sys/dev/ic/anx_dp.h7
-rw-r--r--sys/dev/ic/dw_hdmi.c42
-rw-r--r--sys/dev/ic/dw_hdmi.h15
-rw-r--r--sys/dev/ic/dw_hdmi_phy.c13
8 files changed, 98 insertions, 148 deletions
diff --git a/sys/dev/fdt/fdt_panel.c b/sys/dev/fdt/fdt_panel.c
index 15764ca469d..e056c6d52a6 100644
--- a/sys/dev/fdt/fdt_panel.c
+++ b/sys/dev/fdt/fdt_panel.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_panel.c,v 1.4 2021/11/07 17:11:58 jmcneill Exp $ */
+/* $NetBSD: fdt_panel.c,v 1.5 2021/12/19 11:00:46 riastradh Exp $ */
/*-
* Copyright (c) 2019 Jonathan A. Kollasch <jakllsch@kollasch.net>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_panel.c,v 1.4 2021/11/07 17:11:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_panel.c,v 1.5 2021/12/19 11:00:46 riastradh Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -40,7 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: fdt_panel.c,v 1.4 2021/11/07 17:11:58 jmcneill Exp $
#include <dev/i2c/ddcvar.h>
-#include <drm/drmP.h>
+#include <drm/drm_drv.h>
#include <drm/drm_panel.h>
#include <drm/drm_edid.h>
@@ -158,7 +158,7 @@ panel_fdt_attach(device_t parent, device_t self, void *aux)
sc->sc_ports.dp_ep_get_data = panel_fdt_ep_get_data;
fdt_ports_register(&sc->sc_ports, self, phandle, EP_DRM_PANEL);
- drm_panel_init(&sc->sc_panel);
+ drm_panel_init(&sc->sc_panel, self, &panel_fdt_funcs, DRM_MODE_CONNECTOR_DPI);
sc->sc_panel.funcs = &panel_fdt_funcs;
drm_panel_add(&sc->sc_panel);
diff --git a/sys/dev/fdt/hdmi_connector.c b/sys/dev/fdt/hdmi_connector.c
index 862495c0043..b55fbf1c545 100644
--- a/sys/dev/fdt/hdmi_connector.c
+++ b/sys/dev/fdt/hdmi_connector.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hdmi_connector.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */
+/* $NetBSD: hdmi_connector.c,v 1.3 2021/12/19 11:00:46 riastradh Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdmi_connector.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdmi_connector.c,v 1.3 2021/12/19 11:00:46 riastradh Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -40,10 +40,11 @@ __KERNEL_RCSID(0, "$NetBSD: hdmi_connector.c,v 1.2 2021/01/27 03:10:21 thorpej E
#include <dev/i2c/ddcvar.h>
-#include <drm/drmP.h>
+#include <drm/drm_drv.h>
#include <drm/drm_crtc.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_edid.h>
+#include <drm/drm_probe_helper.h>
static const struct device_compatible_entry compat_data[] = {
{ .compat = "hdmi-connector" },
@@ -132,38 +133,16 @@ dispcon_hdmi_connector_get_modes(struct drm_connector *connector)
}
}
- 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 *
-dispcon_hdmi_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 dispcon_hdmi_connector_helper_funcs = {
.mode_valid = dispcon_hdmi_connector_mode_valid,
.get_modes = dispcon_hdmi_connector_get_modes,
- .best_encoder = dispcon_hdmi_connector_best_encoder,
};
static int
@@ -191,7 +170,7 @@ dispcon_hdmi_ep_activate(device_t dev, struct fdt_endpoint *ep, bool activate)
hdmi_connector->type);
drm_connector_helper_add(connector, &dispcon_hdmi_connector_helper_funcs);
drm_connector_register(connector);
- drm_mode_connector_attach_encoder(connector, encoder);
+ drm_connector_attach_encoder(connector, encoder);
}
return 0;
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;
}
diff --git a/sys/dev/ic/anx_dp.c b/sys/dev/ic/anx_dp.c
index 0015d0cfd43..e8564257b7a 100644
--- a/sys/dev/ic/anx_dp.c
+++ b/sys/dev/ic/anx_dp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: anx_dp.c,v 1.2 2020/01/04 12:08:32 jmcneill Exp $ */
+/* $NetBSD: anx_dp.c,v 1.3 2021/12/19 11:00:47 riastradh Exp $ */
/*-
* Copyright (c) 2019 Jonathan A. Kollasch <jakllsch@kollasch.net>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: anx_dp.c,v 1.2 2020/01/04 12:08:32 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: anx_dp.c,v 1.3 2021/12/19 11:00:47 riastradh Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -43,7 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: anx_dp.c,v 1.2 2020/01/04 12:08:32 jmcneill Exp $");
#include <dev/audio/audio_dai.h>
#endif
-#include <drm/drmP.h>
+#include <drm/drm_drv.h>
#include <drm/drm_crtc.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_dp_helper.h>
@@ -198,6 +198,13 @@ __KERNEL_RCSID(0, "$NetBSD: anx_dp.c,v 1.2 2020/01/04 12:08:32 jmcneill Exp $");
#define ANXDP_PLL_REG_4 0x9ec
#define ANXDP_PLL_REG_5 0xa00
+struct anxdp_link {
+ uint8_t revision;
+ u_int rate;
+ u_int num_lanes;
+ bool enhanced_framing;
+};
+
#if ANXDP_AUDIO
enum anxdp_dai_mixer_ctrl {
ANXDP_DAI_OUTPUT_CLASS,
@@ -348,12 +355,11 @@ anxdp_connector_get_modes(struct drm_connector *connector)
}
#endif
- 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);
if (pedid != NULL)
kfree(pedid);
@@ -361,27 +367,8 @@ anxdp_connector_get_modes(struct drm_connector *connector)
return error;
}
-static struct drm_encoder *
-anxdp_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;
-}
-
static const struct drm_connector_helper_funcs anxdp_connector_helper_funcs = {
.get_modes = anxdp_connector_get_modes,
- .best_encoder = anxdp_connector_best_encoder,
};
static int
@@ -403,7 +390,7 @@ anxdp_bridge_attach(struct drm_bridge *bridge)
connector->connector_type);
drm_connector_helper_add(connector, &anxdp_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;
@@ -424,16 +411,22 @@ anxdp_macro_reset(struct anxdp_softc * const sc)
}
static void
-anxdp_link_start(struct anxdp_softc * const sc, struct drm_dp_link * const link)
+anxdp_link_start(struct anxdp_softc * const sc, struct anxdp_link * const link)
{
uint8_t training[4];
+ uint8_t bw[2];
uint32_t val;
bus_space_write_4(sc->sc_bst, sc->sc_bsh, ANXDP_LINK_BW_SET, drm_dp_link_rate_to_bw_code(link->rate));
bus_space_write_4(sc->sc_bst, sc->sc_bsh, ANXDP_LANE_COUNT_SET, link->num_lanes);
- if (0 != drm_dp_link_configure(&sc->sc_dpaux, link))
- return;
+ bw[0] = drm_dp_link_rate_to_bw_code(link->rate);
+ bw[1] = link->num_lanes;
+ if (link->enhanced_framing)
+ bw[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN;
+ if (drm_dp_dpcd_write(&sc->sc_dpaux, DP_LINK_BW_SET, bw, sizeof(bw)) < 0)
+ return;
+
for (u_int i = 0; i < link->num_lanes; i++) {
val = bus_space_read_4(sc->sc_bst, sc->sc_bsh,
ANXDP_LNx_LINK_TRAINING_CTL(i));
@@ -458,7 +451,7 @@ anxdp_link_start(struct anxdp_softc * const sc, struct drm_dp_link * const link)
static void
anxdp_process_clock_recovery(struct anxdp_softc * const sc,
- struct drm_dp_link * const link)
+ struct anxdp_link * const link)
{
u_int i, tries;
uint8_t link_status[DP_LINK_STATUS_SIZE];
@@ -503,7 +496,7 @@ cr_fail:
}
static void
-anxdp_process_eq(struct anxdp_softc * const sc, struct drm_dp_link * const link)
+anxdp_process_eq(struct anxdp_softc * const sc, struct anxdp_link * const link)
{
u_int i, tries;
uint8_t link_status[DP_LINK_STATUS_SIZE];
@@ -550,16 +543,32 @@ eq_fail:
static void
anxdp_train_link(struct anxdp_softc * const sc)
{
- struct drm_dp_link link;
+ struct anxdp_link link;
+ uint8_t values[3], power;
anxdp_macro_reset(sc);
- if (0 != drm_dp_link_probe(&sc->sc_dpaux, &link)) {
+ if (drm_dp_dpcd_read(&sc->sc_dpaux, DP_DPCD_REV, values, sizeof(values)) < 0) {
device_printf(sc->sc_dev, "link probe failed\n");
return;
}
- if (0 != drm_dp_link_power_up(&sc->sc_dpaux, &link))
- return;
+ memset(&link, 0, sizeof(link));
+ link.revision = values[0];
+ link.rate = drm_dp_bw_code_to_link_rate(values[1]);
+ link.num_lanes = values[2] & DP_MAX_LANE_COUNT_MASK;
+ if (values[2] & DP_ENHANCED_FRAME_CAP)
+ link.enhanced_framing = true;
+
+ if (link.revision >= 0x11) {
+ if (drm_dp_dpcd_readb(&sc->sc_dpaux, DP_SET_POWER, &power) < 0)
+ return;
+ power &= ~DP_SET_POWER_MASK;
+ power |= DP_SET_POWER_D0;
+ if (drm_dp_dpcd_writeb(&sc->sc_dpaux, DP_SET_POWER, power) < 0)
+ return;
+ delay(2000);
+ }
+
if (DP_RECEIVER_CAP_SIZE != drm_dp_dpcd_read(&sc->sc_dpaux, DP_DPCD_REV,
sc->sc_dpcd, DP_RECEIVER_CAP_SIZE))
return;
@@ -718,7 +727,7 @@ anxdp_bridge_post_disable(struct drm_bridge *bridge)
static void
anxdp_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 anxdp_softc * const sc = bridge->driver_private;
@@ -1043,12 +1052,10 @@ anxdp_bind(struct anxdp_softc *sc, struct drm_encoder *encoder)
sc->sc_bridge.funcs = &anxdp_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;
-
if (sc->sc_panel != NULL && sc->sc_panel->funcs != NULL && sc->sc_panel->funcs->prepare != NULL)
sc->sc_panel->funcs->prepare(sc->sc_panel);
diff --git a/sys/dev/ic/anx_dp.h b/sys/dev/ic/anx_dp.h
index 00ba8ac01bd..49f97c46e60 100644
--- a/sys/dev/ic/anx_dp.h
+++ b/sys/dev/ic/anx_dp.h
@@ -1,4 +1,4 @@
-/* $NetBSD: anx_dp.h,v 1.2 2020/01/04 12:08:32 jmcneill Exp $ */
+/* $NetBSD: anx_dp.h,v 1.3 2021/12/19 11:00:47 riastradh Exp $ */
/*-
* Copyright (c) 2019 Jonathan A. Kollasch <jakllsch@kollasch.net>
@@ -33,9 +33,12 @@
#include <dev/audio/audio_dai.h>
#endif
-#include <drm/drmP.h>
+#include <drm/drm_drv.h>
+#include <drm/drm_bridge.h>
+#include <drm/drm_connector.h>
#include <drm/drm_dp_helper.h>
#include <drm/drm_panel.h>
+#include <drm/drm_probe_helper.h>
struct anxdp_softc;
diff --git a/sys/dev/ic/dw_hdmi.c b/sys/dev/ic/dw_hdmi.c
index 47ccf86b76f..3b052decf1a 100644
--- a/sys/dev/ic/dw_hdmi.c
+++ b/sys/dev/ic/dw_hdmi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dw_hdmi.c,v 1.7 2019/12/22 23:23:32 thorpej Exp $ */
+/* $NetBSD: dw_hdmi.c,v 1.8 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: dw_hdmi.c,v 1.7 2019/12/22 23:23:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dw_hdmi.c,v 1.8 2021/12/19 11:00:47 riastradh Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -47,10 +47,11 @@ __KERNEL_RCSID(0, "$NetBSD: dw_hdmi.c,v 1.7 2019/12/22 23:23:32 thorpej Exp $");
#include <dev/audio/audio_dai.h>
-#include <drm/drmP.h>
+#include <drm/drm_drv.h>
#include <drm/drm_crtc.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_edid.h>
+#include <drm/drm_probe_helper.h>
#define HDMI_DESIGN_ID 0x0000
#define HDMI_REVISION_ID 0x0001
@@ -601,37 +602,15 @@ dwhdmi_connector_get_modes(struct drm_connector *connector)
dwhdmi_connector->monitor_audio = false;
}
- 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 *
-dwhdmi_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 dwhdmi_connector_helper_funcs = {
.get_modes = dwhdmi_connector_get_modes,
- .best_encoder = dwhdmi_connector_best_encoder,
};
static int
@@ -652,7 +631,7 @@ dwhdmi_bridge_attach(struct drm_bridge *bridge)
DRM_MODE_CONNECTOR_HDMIA);
drm_connector_helper_add(connector, &dwhdmi_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;
@@ -700,7 +679,8 @@ dwhdmi_bridge_post_disable(struct drm_bridge *bridge)
static void
dwhdmi_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 dwhdmi_softc * const sc = bridge->driver_private;
@@ -917,11 +897,9 @@ dwhdmi_bind(struct dwhdmi_softc *sc, struct drm_encoder *encoder)
sc->sc_bridge.funcs = &dwhdmi_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;
}
diff --git a/sys/dev/ic/dw_hdmi.h b/sys/dev/ic/dw_hdmi.h
index b86c85cc846..0c5d4d8f5d3 100644
--- a/sys/dev/ic/dw_hdmi.h
+++ b/sys/dev/ic/dw_hdmi.h
@@ -1,4 +1,4 @@
-/* $NetBSD: dw_hdmi.h,v 1.6 2019/12/22 23:23:32 thorpej Exp $ */
+/* $NetBSD: dw_hdmi.h,v 1.7 2021/12/19 11:00:47 riastradh Exp $ */
/*-
* Copyright (c) 2019 Jared D. McNeill <jmcneill@invisible.ca>
@@ -34,7 +34,10 @@
#include <dev/audio/audio_dai.h>
-#include <drm/drmP.h>
+#include <drm/drm_drv.h>
+#include <drm/drm_bridge.h>
+#include <drm/drm_connector.h>
+#include <drm/drm_modes.h>
struct dwhdmi_softc;
@@ -91,8 +94,8 @@ struct dwhdmi_softc {
void (*sc_enable)(struct dwhdmi_softc *);
void (*sc_disable)(struct dwhdmi_softc *);
void (*sc_mode_set)(struct dwhdmi_softc *,
- struct drm_display_mode *,
- struct drm_display_mode *);
+ const struct drm_display_mode *,
+ const struct drm_display_mode *);
};
#define to_dwhdmi_connector(x) container_of(x, struct dwhdmi_connector, base)
@@ -107,7 +110,7 @@ enum drm_connector_status dwhdmi_phy_detect(struct dwhdmi_softc *, bool);
void dwhdmi_phy_enable(struct dwhdmi_softc *);
void dwhdmi_phy_disable(struct dwhdmi_softc *);
void dwhdmi_phy_mode_set(struct dwhdmi_softc *,
- struct drm_display_mode *,
- struct drm_display_mode *);
+ const struct drm_display_mode *,
+ const struct drm_display_mode *);
#endif /* !_DEV_IC_DWHDMI_H */
diff --git a/sys/dev/ic/dw_hdmi_phy.c b/sys/dev/ic/dw_hdmi_phy.c
index 3deaee528dc..d53f101f9a1 100644
--- a/sys/dev/ic/dw_hdmi_phy.c
+++ b/sys/dev/ic/dw_hdmi_phy.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dw_hdmi_phy.c,v 1.2 2019/11/10 10:36:01 jmcneill Exp $ */
+/* $NetBSD: dw_hdmi_phy.c,v 1.3 2021/12/19 11:00:47 riastradh Exp $ */
/*-
* Copyright (c) 2015 Oleksandr Tymoshenko <gonzo@freebsd.org>
@@ -27,11 +27,11 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dw_hdmi_phy.c,v 1.2 2019/11/10 10:36:01 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dw_hdmi_phy.c,v 1.3 2021/12/19 11:00:47 riastradh Exp $");
#include <sys/param.h>
-#include <drm/drmP.h>
+#include <drm/drm_drv.h>
#include <dev/ic/dw_hdmi.h>
@@ -267,7 +267,7 @@ dwhdmi_phy_test_clear(struct dwhdmi_softc *sc, unsigned char bit)
}
static int
-dwhdmi_phy_configure(struct dwhdmi_softc *sc, struct drm_display_mode *mode)
+dwhdmi_phy_configure(struct dwhdmi_softc *sc, const struct drm_display_mode *mode)
{
const struct dwhdmi_mpll_config *mpll_conf;
const struct dwhdmi_phy_config *phy_conf;
@@ -355,7 +355,7 @@ dwhdmi_phy_configure(struct dwhdmi_softc *sc, struct drm_display_mode *mode)
}
static void
-dwhdmi_phy_init(struct dwhdmi_softc *sc, struct drm_display_mode *mode)
+dwhdmi_phy_init(struct dwhdmi_softc *sc, const struct drm_display_mode *mode)
{
int i;
@@ -395,7 +395,8 @@ dwhdmi_phy_disable(struct dwhdmi_softc *sc)
void
dwhdmi_phy_mode_set(struct dwhdmi_softc *sc,
- struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
dwhdmi_phy_init(sc, adjusted_mode);
}