Commit 02ac4371 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-misc-next-fixes-2024-03-14' of...

Merge tag 'drm-misc-next-fixes-2024-03-14' of https://gitlab.freedesktop.org/drm/misc/kernel

 into drm-next

Short summary of fixes pull:

probe-helper:
- never return negative values from .get_modes() plus driver fixes

nouveau:
- clear bo resource bus after eviction
- documentation fixes

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240314082833.GA8761@localhost.localdomain
parents 341f7081 9dd81b2e
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -441,23 +441,21 @@ lt8912_connector_mode_valid(struct drm_connector *connector,
static int lt8912_connector_get_modes(struct drm_connector *connector)
{
	const struct drm_edid *drm_edid;
	int ret = -1;
	int num = 0;
	struct lt8912 *lt = connector_to_lt8912(connector);
	u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
	int ret, num;

	drm_edid = drm_bridge_edid_read(lt->hdmi_port, connector);
	drm_edid_connector_update(connector, drm_edid);
	if (drm_edid) {
	if (!drm_edid)
		return 0;

	num = drm_edid_connector_add_modes(connector);
	} else {
		return ret;
	}

	ret = drm_display_info_set_bus_formats(&connector->display_info,
					       &bus_format, 1);
	if (ret)
		num = ret;
	if (ret < 0)
		num = 0;

	drm_edid_free(drm_edid);
	return num;
+1 −1
Original line number Diff line number Diff line
@@ -294,8 +294,8 @@ static struct mipi_dsi_device *lt9611uxc_attach_dsi(struct lt9611uxc *lt9611uxc,
static int lt9611uxc_connector_get_modes(struct drm_connector *connector)
{
	struct lt9611uxc *lt9611uxc = connector_to_lt9611uxc(connector);
	unsigned int count;
	const struct drm_edid *drm_edid;
	int count;

	drm_edid = drm_bridge_edid_read(&lt9611uxc->bridge, connector);
	drm_edid_connector_update(connector, drm_edid);
+11 −6
Original line number Diff line number Diff line
@@ -274,19 +274,24 @@ EXPORT_SYMBOL(drm_panel_disable);
 * The modes probed from the panel are automatically added to the connector
 * that the panel is attached to.
 *
 * Return: The number of modes available from the panel on success or a
 * negative error code on failure.
 * Return: The number of modes available from the panel on success, or 0 on
 * failure (no modes).
 */
int drm_panel_get_modes(struct drm_panel *panel,
			struct drm_connector *connector)
{
	if (!panel)
		return -EINVAL;
		return 0;

	if (panel->funcs && panel->funcs->get_modes)
		return panel->funcs->get_modes(panel, connector);
	if (panel->funcs && panel->funcs->get_modes) {
		int num;

	return -EOPNOTSUPP;
		num = panel->funcs->get_modes(panel, connector);
		if (num > 0)
			return num;
	}

	return 0;
}
EXPORT_SYMBOL(drm_panel_get_modes);

+7 −0
Original line number Diff line number Diff line
@@ -422,6 +422,13 @@ static int drm_helper_probe_get_modes(struct drm_connector *connector)

	count = connector_funcs->get_modes(connector);

	/* The .get_modes() callback should not return negative values. */
	if (count < 0) {
		drm_err(connector->dev, ".get_modes() returned %pe\n",
			ERR_PTR(count));
		count = 0;
	}

	/*
	 * Fallback for when DDC probe failed in drm_get_edid() and thus skipped
	 * override/firmware EDID.
+3 −4
Original line number Diff line number Diff line
@@ -74,16 +74,15 @@ static int exynos_dp_get_modes(struct analogix_dp_plat_data *plat_data,
{
	struct exynos_dp_device *dp = to_dp(plat_data);
	struct drm_display_mode *mode;
	int num_modes = 0;

	if (dp->plat_data.panel)
		return num_modes;
		return 0;

	mode = drm_mode_create(connector->dev);
	if (!mode) {
		DRM_DEV_ERROR(dp->dev,
			      "failed to create a new display mode.\n");
		return num_modes;
		return 0;
	}

	drm_display_mode_from_videomode(&dp->vm, mode);
@@ -94,7 +93,7 @@ static int exynos_dp_get_modes(struct analogix_dp_plat_data *plat_data,
	drm_mode_set_name(mode);
	drm_mode_probed_add(connector, mode);

	return num_modes + 1;
	return 1;
}

static int exynos_dp_bridge_attach(struct analogix_dp_plat_data *plat_data,
Loading