Commit 4eb39974 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-misc-fixes-2024-08-01' of...

Merge tag 'drm-misc-fixes-2024-08-01' of https://gitlab.freedesktop.org/drm/misc/kernel

 into drm-fixes

A couple drm_panic fixes, several v3d fixes to increase the new timestamp API
safety, several fixes for vmwgfx for various modesetting issues, PM fixes
for ast, async flips improvements and two fixes for nouveau to fix
resource refcounting and buffer placement.

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

From: Maxime Ripard <mripard@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240801-interesting-antique-bat-2fe4c0@houat
parents 7b9b7651 9c685f61
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -268,6 +268,7 @@ config DRM_EXEC
config DRM_GPUVM
	tristate
	depends on DRM
	select DRM_EXEC
	help
	  GPU-VM representation providing helpers to manage a GPUs virtual
	  address space
+7 −0
Original line number Diff line number Diff line
@@ -158,7 +158,14 @@ void ast_dp_launch(struct drm_device *dev)
			       ASTDP_HOST_EDID_READ_DONE);
}

bool ast_dp_power_is_on(struct ast_device *ast)
{
	u8 vgacre3;

	vgacre3 = ast_get_index_reg(ast, AST_IO_VGACRI, 0xe3);

	return !(vgacre3 & AST_DP_PHY_SLEEP);
}

void ast_dp_power_on_off(struct drm_device *dev, bool on)
{
+5 −0
Original line number Diff line number Diff line
@@ -391,6 +391,11 @@ static int ast_drm_freeze(struct drm_device *dev)

static int ast_drm_thaw(struct drm_device *dev)
{
	struct ast_device *ast = to_ast_device(dev);

	ast_enable_vga(ast->ioregs);
	ast_open_key(ast->ioregs);
	ast_enable_mmio(dev->dev, ast->ioregs);
	ast_post_gpu(dev);

	return drm_mode_config_helper_resume(dev);
+1 −0
Original line number Diff line number Diff line
@@ -472,6 +472,7 @@ void ast_init_3rdtx(struct drm_device *dev);
bool ast_astdp_is_connected(struct ast_device *ast);
int ast_astdp_read_edid(struct drm_device *dev, u8 *ediddata);
void ast_dp_launch(struct drm_device *dev);
bool ast_dp_power_is_on(struct ast_device *ast);
void ast_dp_power_on_off(struct drm_device *dev, bool no);
void ast_dp_set_on_off(struct drm_device *dev, bool no);
void ast_dp_set_mode(struct drm_crtc *crtc, struct ast_vbios_mode_info *vbios_mode);
+27 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
 * Authors: Dave Airlie <airlied@redhat.com>
 */

#include <linux/delay.h>
#include <linux/export.h>
#include <linux/pci.h>

@@ -1687,11 +1688,35 @@ static int ast_astdp_connector_helper_detect_ctx(struct drm_connector *connector
						 struct drm_modeset_acquire_ctx *ctx,
						 bool force)
{
	struct drm_device *dev = connector->dev;
	struct ast_device *ast = to_ast_device(connector->dev);
	enum drm_connector_status status = connector_status_disconnected;
	struct drm_connector_state *connector_state = connector->state;
	bool is_active = false;

	mutex_lock(&ast->modeset_lock);

	if (connector_state && connector_state->crtc) {
		struct drm_crtc_state *crtc_state = connector_state->crtc->state;

		if (crtc_state && crtc_state->active)
			is_active = true;
	}

	if (!is_active && !ast_dp_power_is_on(ast)) {
		ast_dp_power_on_off(dev, true);
		msleep(50);
	}

	if (ast_astdp_is_connected(ast))
		return connector_status_connected;
	return connector_status_disconnected;
		status = connector_status_connected;

	if (!is_active && status == connector_status_disconnected)
		ast_dp_power_on_off(dev, false);

	mutex_unlock(&ast->modeset_lock);

	return status;
}

static const struct drm_connector_helper_funcs ast_astdp_connector_helper_funcs = {
Loading