Skip to content

Commit 748f41f

Browse files
committed
Merge tag 'drm-intel-next-2025-09-12' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next
Cross-subsystem Changes: - Overflow: add range_overflows and range_end_overflows (Jani) Core Changes: - Get rid of dev->struct_mutex (Luiz) Non-display related: - GVT: Remove redundant ternary operators (Liao) - Various i915_utils clean-ups (Jani) Display related: - Wait PSR idle before on dsb commit (Jouni) - Fix size for for_each_set_bit() in abox iteration (Jani) - Abstract figuring out encoder name (Jani) - Remove FBC modulo 4 restriction for ADL-P+ (Uma) - Panic: refactor framebuffer allocation (Jani) - Backlight luminance control improvements (Suraj, Aaron) - Add intel_display_device_present (Jani) Signed-off-by: Dave Airlie <[email protected]> From: Rodrigo Vivi <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2 parents 1240767 + 65805c2 commit 748f41f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+770
-621
lines changed

Documentation/gpu/i915.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -358,20 +358,13 @@ Locking Guidelines
358358
#. All locking rules and interface contracts with cross-driver interfaces
359359
(dma-buf, dma_fence) need to be followed.
360360

361-
#. No struct_mutex anywhere in the code
362-
363361
#. dma_resv will be the outermost lock (when needed) and ww_acquire_ctx
364362
is to be hoisted at highest level and passed down within i915_gem_ctx
365363
in the call chain
366364

367365
#. While holding lru/memory manager (buddy, drm_mm, whatever) locks
368366
system memory allocations are not allowed
369367

370-
* Enforce this by priming lockdep (with fs_reclaim). If we
371-
allocate memory while holding these looks we get a rehash
372-
of the shrinker vs. struct_mutex saga, and that would be
373-
real bad.
374-
375368
#. Do not nest different lru/memory manager locks within each other.
376369
Take them in turn to update memory allocations, relying on the object’s
377370
dma_resv ww_mutex to serialize against other operations.

Documentation/gpu/todo.rst

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -173,31 +173,6 @@ Contact: Simona Vetter
173173

174174
Level: Intermediate
175175

176-
Get rid of dev->struct_mutex from GEM drivers
177-
---------------------------------------------
178-
179-
``dev->struct_mutex`` is the Big DRM Lock from legacy days and infested
180-
everything. Nowadays in modern drivers the only bit where it's mandatory is
181-
serializing GEM buffer object destruction. Which unfortunately means drivers
182-
have to keep track of that lock and either call ``unreference`` or
183-
``unreference_locked`` depending upon context.
184-
185-
Core GEM doesn't have a need for ``struct_mutex`` any more since kernel 4.8,
186-
and there's a GEM object ``free`` callback for any drivers which are
187-
entirely ``struct_mutex`` free.
188-
189-
For drivers that need ``struct_mutex`` it should be replaced with a driver-
190-
private lock. The tricky part is the BO free functions, since those can't
191-
reliably take that lock any more. Instead state needs to be protected with
192-
suitable subordinate locks or some cleanup work pushed to a worker thread. For
193-
performance-critical drivers it might also be better to go with a more
194-
fine-grained per-buffer object and per-context lockings scheme. Currently only
195-
the ``msm`` and `i915` drivers use ``struct_mutex``.
196-
197-
Contact: Simona Vetter, respective driver maintainers
198-
199-
Level: Advanced
200-
201176
Move Buffer Object Locking to dma_resv_lock()
202177
---------------------------------------------
203178

drivers/gpu/drm/drm_drv.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,6 @@ static void drm_dev_init_release(struct drm_device *dev, void *res)
696696
mutex_destroy(&dev->master_mutex);
697697
mutex_destroy(&dev->clientlist_mutex);
698698
mutex_destroy(&dev->filelist_mutex);
699-
mutex_destroy(&dev->struct_mutex);
700699
}
701700

702701
static int drm_dev_init(struct drm_device *dev,
@@ -737,7 +736,6 @@ static int drm_dev_init(struct drm_device *dev,
737736
INIT_LIST_HEAD(&dev->vblank_event_list);
738737

739738
spin_lock_init(&dev->event_lock);
740-
mutex_init(&dev->struct_mutex);
741739
mutex_init(&dev->filelist_mutex);
742740
mutex_init(&dev->clientlist_mutex);
743741
mutex_init(&dev->master_mutex);

drivers/gpu/drm/i915/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ i915-y += \
3232
i915_scatterlist.o \
3333
i915_switcheroo.o \
3434
i915_sysfs.o \
35+
i915_timer_util.o \
3536
i915_utils.o \
3637
intel_clock_gating.o \
3738
intel_cpu_info.o \
@@ -280,6 +281,7 @@ i915-y += \
280281
display/intel_modeset_setup.o \
281282
display/intel_modeset_verify.o \
282283
display/intel_overlay.o \
284+
display/intel_panic.o \
283285
display/intel_pch.o \
284286
display/intel_pch_display.o \
285287
display/intel_pch_refclk.o \

drivers/gpu/drm/i915/display/i9xx_plane.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
#include "i9xx_plane.h"
1616
#include "i9xx_plane_regs.h"
1717
#include "intel_atomic.h"
18-
#include "intel_bo.h"
1918
#include "intel_de.h"
2019
#include "intel_display_irq.h"
2120
#include "intel_display_regs.h"
2221
#include "intel_display_types.h"
2322
#include "intel_fb.h"
2423
#include "intel_fbc.h"
2524
#include "intel_frontbuffer.h"
25+
#include "intel_panic.h"
2626
#include "intel_plane.h"
2727
#include "intel_sprite.h"
2828

@@ -1178,7 +1178,7 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
11781178

11791179
drm_WARN_ON(display->drm, pipe != crtc->pipe);
11801180

1181-
intel_fb = intel_bo_alloc_framebuffer();
1181+
intel_fb = intel_framebuffer_alloc();
11821182
if (!intel_fb) {
11831183
drm_dbg_kms(display->drm, "failed to alloc fb\n");
11841184
return;

drivers/gpu/drm/i915/display/intel_bo.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,3 @@ void intel_bo_describe(struct seq_file *m, struct drm_gem_object *obj)
5959
{
6060
i915_debugfs_describe_obj(m, to_intel_bo(obj));
6161
}
62-
63-
struct intel_framebuffer *intel_bo_alloc_framebuffer(void)
64-
{
65-
return i915_gem_object_alloc_framebuffer();
66-
}
67-
68-
int intel_bo_panic_setup(struct drm_scanout_buffer *sb)
69-
{
70-
return i915_gem_object_panic_setup(sb);
71-
}
72-
73-
void intel_bo_panic_finish(struct intel_framebuffer *fb)
74-
{
75-
return i915_gem_object_panic_finish(fb);
76-
}

drivers/gpu/drm/i915/display/intel_bo.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,5 @@ struct intel_frontbuffer *intel_bo_set_frontbuffer(struct drm_gem_object *obj,
2525
struct intel_frontbuffer *front);
2626

2727
void intel_bo_describe(struct seq_file *m, struct drm_gem_object *obj);
28-
struct intel_framebuffer *intel_bo_alloc_framebuffer(void);
29-
int intel_bo_panic_setup(struct drm_scanout_buffer *sb);
30-
void intel_bo_panic_finish(struct intel_framebuffer *fb);
3128

3229
#endif /* __INTEL_BO__ */

drivers/gpu/drm/i915/display/intel_ddi.c

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
*/
2727

2828
#include <linux/iopoll.h>
29+
#include <linux/seq_buf.h>
2930
#include <linux/string_helpers.h>
3031

3132
#include <drm/display/drm_dp_helper.h>
@@ -5067,11 +5068,45 @@ static bool port_in_use(struct intel_display *display, enum port port)
50675068
return false;
50685069
}
50695070

5071+
static const char *intel_ddi_encoder_name(struct intel_display *display,
5072+
enum port port, enum phy phy,
5073+
struct seq_buf *s)
5074+
{
5075+
if (DISPLAY_VER(display) >= 13 && port >= PORT_D_XELPD) {
5076+
seq_buf_printf(s, "DDI %c/PHY %c",
5077+
port_name(port - PORT_D_XELPD + PORT_D),
5078+
phy_name(phy));
5079+
} else if (DISPLAY_VER(display) >= 12) {
5080+
enum tc_port tc_port = intel_port_to_tc(display, port);
5081+
5082+
seq_buf_printf(s, "DDI %s%c/PHY %s%c",
5083+
port >= PORT_TC1 ? "TC" : "",
5084+
port >= PORT_TC1 ? port_tc_name(port) : port_name(port),
5085+
tc_port != TC_PORT_NONE ? "TC" : "",
5086+
tc_port != TC_PORT_NONE ? tc_port_name(tc_port) : phy_name(phy));
5087+
} else if (DISPLAY_VER(display) >= 11) {
5088+
enum tc_port tc_port = intel_port_to_tc(display, port);
5089+
5090+
seq_buf_printf(s, "DDI %c%s/PHY %s%c",
5091+
port_name(port),
5092+
port >= PORT_C ? " (TC)" : "",
5093+
tc_port != TC_PORT_NONE ? "TC" : "",
5094+
tc_port != TC_PORT_NONE ? tc_port_name(tc_port) : phy_name(phy));
5095+
} else {
5096+
seq_buf_printf(s, "DDI %c/PHY %c", port_name(port), phy_name(phy));
5097+
}
5098+
5099+
drm_WARN_ON(display->drm, seq_buf_has_overflowed(s));
5100+
5101+
return seq_buf_str(s);
5102+
}
5103+
50705104
void intel_ddi_init(struct intel_display *display,
50715105
const struct intel_bios_encoder_data *devdata)
50725106
{
50735107
struct intel_digital_port *dig_port;
50745108
struct intel_encoder *encoder;
5109+
DECLARE_SEQ_BUF(encoder_name, 20);
50755110
bool init_hdmi, init_dp;
50765111
enum port port;
50775112
enum phy phy;
@@ -5156,37 +5191,9 @@ void intel_ddi_init(struct intel_display *display,
51565191
encoder = &dig_port->base;
51575192
encoder->devdata = devdata;
51585193

5159-
if (DISPLAY_VER(display) >= 13 && port >= PORT_D_XELPD) {
5160-
drm_encoder_init(display->drm, &encoder->base, &intel_ddi_funcs,
5161-
DRM_MODE_ENCODER_TMDS,
5162-
"DDI %c/PHY %c",
5163-
port_name(port - PORT_D_XELPD + PORT_D),
5164-
phy_name(phy));
5165-
} else if (DISPLAY_VER(display) >= 12) {
5166-
enum tc_port tc_port = intel_port_to_tc(display, port);
5167-
5168-
drm_encoder_init(display->drm, &encoder->base, &intel_ddi_funcs,
5169-
DRM_MODE_ENCODER_TMDS,
5170-
"DDI %s%c/PHY %s%c",
5171-
port >= PORT_TC1 ? "TC" : "",
5172-
port >= PORT_TC1 ? port_tc_name(port) : port_name(port),
5173-
tc_port != TC_PORT_NONE ? "TC" : "",
5174-
tc_port != TC_PORT_NONE ? tc_port_name(tc_port) : phy_name(phy));
5175-
} else if (DISPLAY_VER(display) >= 11) {
5176-
enum tc_port tc_port = intel_port_to_tc(display, port);
5177-
5178-
drm_encoder_init(display->drm, &encoder->base, &intel_ddi_funcs,
5179-
DRM_MODE_ENCODER_TMDS,
5180-
"DDI %c%s/PHY %s%c",
5181-
port_name(port),
5182-
port >= PORT_C ? " (TC)" : "",
5183-
tc_port != TC_PORT_NONE ? "TC" : "",
5184-
tc_port != TC_PORT_NONE ? tc_port_name(tc_port) : phy_name(phy));
5185-
} else {
5186-
drm_encoder_init(display->drm, &encoder->base, &intel_ddi_funcs,
5187-
DRM_MODE_ENCODER_TMDS,
5188-
"DDI %c/PHY %c", port_name(port), phy_name(phy));
5189-
}
5194+
drm_encoder_init(display->drm, &encoder->base, &intel_ddi_funcs,
5195+
DRM_MODE_ENCODER_TMDS, "%s",
5196+
intel_ddi_encoder_name(display, port, phy, &encoder_name));
51905197

51915198
intel_encoder_link_check_init(encoder, intel_ddi_link_check);
51925199

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7271,6 +7271,9 @@ static void intel_atomic_dsb_finish(struct intel_atomic_state *state,
72717271
intel_psr_trigger_frame_change_event(new_crtc_state->dsb_commit,
72727272
state, crtc);
72737273

7274+
intel_psr_wait_for_idle_dsb(new_crtc_state->dsb_commit,
7275+
new_crtc_state);
7276+
72747277
if (new_crtc_state->use_dsb)
72757278
intel_dsb_vblank_evade(state, new_crtc_state->dsb_commit);
72767279

drivers/gpu/drm/i915/display/intel_display_device.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,6 +1944,11 @@ void intel_display_device_info_print(const struct intel_display_device_info *inf
19441944
drm_printf(p, "rawclk rate: %u kHz\n", runtime->rawclk_freq);
19451945
}
19461946

1947+
bool intel_display_device_present(struct intel_display *display)
1948+
{
1949+
return display && HAS_DISPLAY(display);
1950+
}
1951+
19471952
/*
19481953
* Assuming the device has display hardware, should it be enabled?
19491954
*

0 commit comments

Comments
 (0)