Skip to content

Commit 4eb3997

Browse files
committed
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: Dave Airlie <[email protected]> From: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20240801-interesting-antique-bat-2fe4c0@houat
2 parents 7b9b765 + 9c685f6 commit 4eb3997

32 files changed

+1050
-588
lines changed

drivers/gpu/drm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ config DRM_EXEC
268268
config DRM_GPUVM
269269
tristate
270270
depends on DRM
271+
select DRM_EXEC
271272
help
272273
GPU-VM representation providing helpers to manage a GPUs virtual
273274
address space

drivers/gpu/drm/ast/ast_dp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,14 @@ void ast_dp_launch(struct drm_device *dev)
158158
ASTDP_HOST_EDID_READ_DONE);
159159
}
160160

161+
bool ast_dp_power_is_on(struct ast_device *ast)
162+
{
163+
u8 vgacre3;
164+
165+
vgacre3 = ast_get_index_reg(ast, AST_IO_VGACRI, 0xe3);
161166

167+
return !(vgacre3 & AST_DP_PHY_SLEEP);
168+
}
162169

163170
void ast_dp_power_on_off(struct drm_device *dev, bool on)
164171
{

drivers/gpu/drm/ast/ast_drv.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,11 @@ static int ast_drm_freeze(struct drm_device *dev)
391391

392392
static int ast_drm_thaw(struct drm_device *dev)
393393
{
394+
struct ast_device *ast = to_ast_device(dev);
395+
396+
ast_enable_vga(ast->ioregs);
397+
ast_open_key(ast->ioregs);
398+
ast_enable_mmio(dev->dev, ast->ioregs);
394399
ast_post_gpu(dev);
395400

396401
return drm_mode_config_helper_resume(dev);

drivers/gpu/drm/ast/ast_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ void ast_init_3rdtx(struct drm_device *dev);
472472
bool ast_astdp_is_connected(struct ast_device *ast);
473473
int ast_astdp_read_edid(struct drm_device *dev, u8 *ediddata);
474474
void ast_dp_launch(struct drm_device *dev);
475+
bool ast_dp_power_is_on(struct ast_device *ast);
475476
void ast_dp_power_on_off(struct drm_device *dev, bool no);
476477
void ast_dp_set_on_off(struct drm_device *dev, bool no);
477478
void ast_dp_set_mode(struct drm_crtc *crtc, struct ast_vbios_mode_info *vbios_mode);

drivers/gpu/drm/ast/ast_mode.c

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* Authors: Dave Airlie <[email protected]>
2929
*/
3030

31+
#include <linux/delay.h>
3132
#include <linux/export.h>
3233
#include <linux/pci.h>
3334

@@ -1687,11 +1688,35 @@ static int ast_astdp_connector_helper_detect_ctx(struct drm_connector *connector
16871688
struct drm_modeset_acquire_ctx *ctx,
16881689
bool force)
16891690
{
1691+
struct drm_device *dev = connector->dev;
16901692
struct ast_device *ast = to_ast_device(connector->dev);
1693+
enum drm_connector_status status = connector_status_disconnected;
1694+
struct drm_connector_state *connector_state = connector->state;
1695+
bool is_active = false;
1696+
1697+
mutex_lock(&ast->modeset_lock);
1698+
1699+
if (connector_state && connector_state->crtc) {
1700+
struct drm_crtc_state *crtc_state = connector_state->crtc->state;
1701+
1702+
if (crtc_state && crtc_state->active)
1703+
is_active = true;
1704+
}
1705+
1706+
if (!is_active && !ast_dp_power_is_on(ast)) {
1707+
ast_dp_power_on_off(dev, true);
1708+
msleep(50);
1709+
}
16911710

16921711
if (ast_astdp_is_connected(ast))
1693-
return connector_status_connected;
1694-
return connector_status_disconnected;
1712+
status = connector_status_connected;
1713+
1714+
if (!is_active && status == connector_status_disconnected)
1715+
ast_dp_power_on_off(dev, false);
1716+
1717+
mutex_unlock(&ast->modeset_lock);
1718+
1719+
return status;
16951720
}
16961721

16971722
static const struct drm_connector_helper_funcs ast_astdp_connector_helper_funcs = {

drivers/gpu/drm/drm_atomic_uapi.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,10 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
10701070
break;
10711071
}
10721072

1073-
if (async_flip && prop != config->prop_fb_id) {
1073+
if (async_flip &&
1074+
prop != config->prop_fb_id &&
1075+
prop != config->prop_in_fence_fd &&
1076+
prop != config->prop_fb_damage_clips) {
10741077
ret = drm_atomic_plane_get_property(plane, plane_state,
10751078
prop, &old_val);
10761079
ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);

drivers/gpu/drm/drm_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ int drm_client_buffer_vmap_local(struct drm_client_buffer *buffer,
355355

356356
err_drm_gem_vmap_unlocked:
357357
drm_gem_unlock(gem);
358-
return 0;
358+
return ret;
359359
}
360360
EXPORT_SYMBOL(drm_client_buffer_vmap_local);
361361

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,17 @@ static void drm_fb_helper_add_damage_clip(struct drm_fb_helper *helper, u32 x, u
624624
static void drm_fb_helper_damage(struct drm_fb_helper *helper, u32 x, u32 y,
625625
u32 width, u32 height)
626626
{
627+
/*
628+
* This function may be invoked by panic() to flush the frame
629+
* buffer, where all CPUs except the panic CPU are stopped.
630+
* During the following schedule_work(), the panic CPU needs
631+
* the worker_pool lock, which might be held by a stopped CPU,
632+
* causing schedule_work() and panic() to block. Return early on
633+
* oops_in_progress to prevent this blocking.
634+
*/
635+
if (oops_in_progress)
636+
return;
637+
627638
drm_fb_helper_add_damage_clip(helper, x, y, width, height);
628639

629640
schedule_work(&helper->damage_work);

drivers/gpu/drm/drm_panel_orientation_quirks.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,12 @@ static const struct dmi_system_id orientation_data[] = {
414414
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ONE XPLAYER"),
415415
},
416416
.driver_data = (void *)&lcd1600x2560_leftside_up,
417+
}, { /* OrangePi Neo */
418+
.matches = {
419+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "OrangePi"),
420+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "NEO-01"),
421+
},
422+
.driver_data = (void *)&lcd1200x1920_rightside_up,
417423
}, { /* Samsung GalaxyBook 10.6 */
418424
.matches = {
419425
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),

drivers/gpu/drm/nouveau/nouveau_prime.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ struct drm_gem_object *nouveau_gem_prime_import_sg_table(struct drm_device *dev,
6464
* to the caller, instead of a normal nouveau_bo ttm reference. */
6565
ret = drm_gem_object_init(dev, &nvbo->bo.base, size);
6666
if (ret) {
67-
nouveau_bo_ref(NULL, &nvbo);
67+
drm_gem_object_release(&nvbo->bo.base);
68+
kfree(nvbo);
6869
obj = ERR_PTR(-ENOMEM);
6970
goto unlock;
7071
}

0 commit comments

Comments
 (0)