History

Merge tag 'drm-misc-fixes-2024-09-26' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes

Short summary of fixes pull: atomic: - Use correct type when reading damage rectangles display: - Fix kernel docs dp-mst: - Fix DSC decompression detection hdmi: - Fix infoframe size panthor: - Fix locking sched: - Update maintainers - Fix race condition whne queueing up jobs sysfb: - Disable sysfb if framebuffer parent device is unknown vbox: - Fix VLA handling Signed-off-by: Dave Airlie <airlied@redhat.com>

Dave Airlie committed 2 years ago

Commit 43102a22 parents 9852d85 ad604f014 files · +56 −26Browse files

Unified · Split

14 files
  1. Documentation/gpu/drm-kms-helpers.rst +2 −2
  2. MAINTAINERS +2 −0
  3. drivers/firmware/sysfb.c +3 −1
  4. drivers/gpu/drm/display/drm_dp_mst_topology.c +8 −2
  5. drivers/gpu/drm/display/drm_hdmi_state_helper.c +1 −3
  6. drivers/gpu/drm/drm_atomic_uapi.c +1 −1
  7. drivers/gpu/drm/drm_debugfs.c +1 −3
  8. drivers/gpu/drm/panthor/panthor_sched.c +14 −2
  9. drivers/gpu/drm/scheduler/sched_entity.c +2 −2
  10. drivers/gpu/drm/scheduler/sched_main.c +2 −5
  11. drivers/gpu/drm/vboxvideo/hgsmi_base.c +9 −1
  12. drivers/gpu/drm/vboxvideo/vboxvideo.h +1 −3
  13. include/drm/gpu_scheduler.h +1 −1
  14. include/linux/hdmi.h +9 −0
Documentation/gpu/drm-kms-helpers.rst+2−2
@@ -181,7 +181,7 @@ Bridge Operations · 180 unmodified lines
181181 Bridge Connector Helper
182182 -----------------------
183183
184−.. kernel-doc:: drivers/gpu/drm/drm_bridge_connector.c
184+.. kernel-doc:: drivers/gpu/drm/display/drm_bridge_connector.c
185185 :doc: overview
186186
187187
@@ -204,7 +204,7 @@ MIPI-DSI bridge operation · 16 unmodified lines
204204 Bridge Connector Helper Reference
205205 ---------------------------------
206206
207−.. kernel-doc:: drivers/gpu/drm/drm_bridge_connector.c
207+.. kernel-doc:: drivers/gpu/drm/display/drm_bridge_connector.c
208208 :export:
209209
210210 Panel-Bridge Helper Reference
MAINTAINERS+2−0
@@ -7832,6 +7832,8 @@ F: drivers/gpu/drm/xlnx/ · 7831 unmodified lines
78327832 DRM GPU SCHEDULER
78337833 M: Luben Tuikov <ltuikov89@gmail.com>
78347834 M: Matthew Brost <matthew.brost@intel.com>
7835+M: Danilo Krummrich <dakr@kernel.org>
7836+M: Philipp Stanner <pstanner@redhat.com>
78357837 L: dri-devel@lists.freedesktop.org
78367838 S: Maintained
78377839 T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
drivers/firmware/sysfb.c+3−1
@@ -67,9 +67,11 @@ static bool sysfb_unregister(void) · 66 unmodified lines
6767 void sysfb_disable(struct device *dev)
6868 {
6969 struct screen_info *si = &screen_info;
70+ struct device *parent;
7071
7172 mutex_lock(&disable_lock);
72− if (!dev || dev == sysfb_parent_dev(si)) {
73+ parent = sysfb_parent_dev(si);
74+ if (!dev || !parent || dev == parent) {
7375 sysfb_unregister();
7476 disabled = true;
7577 }
drivers/gpu/drm/display/drm_dp_mst_topology.c+8−2
@@ -6083,6 +6083,7 @@ struct drm_dp_aux *drm_dp_mst_dsc_aux_for_port(struct drm_dp_mst_port *port) · 6082 unmodified lines
60836083 struct drm_dp_aux *immediate_upstream_aux;
60846084 struct drm_dp_mst_port *fec_port;
60856085 struct drm_dp_desc desc = {};
6086+ u8 upstream_dsc;
60866087 u8 endpoint_fec;
60876088 u8 endpoint_dsc;
60886089
@@ -6109,8 +6110,6 @@ struct drm_dp_aux *drm_dp_mst_dsc_aux_for_port(struct drm_dp_mst_port *port) · 20 unmodified lines
61096110
61106111 /* DP-to-DP peer device */
61116112 if (drm_dp_mst_is_virtual_dpcd(immediate_upstream_port)) {
6112− u8 upstream_dsc;
6113−
61146113 if (drm_dp_dpcd_read(&port->aux,
61156114 DP_DSC_SUPPORT, &endpoint_dsc, 1) != 1)
61166115 return NULL;
@@ -6156,6 +6155,13 @@ struct drm_dp_aux *drm_dp_mst_dsc_aux_for_port(struct drm_dp_mst_port *port) · 39 unmodified lines
61566155 if (drm_dp_has_quirk(&desc, DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD)) {
61576156 u8 dpcd_ext[DP_RECEIVER_CAP_SIZE];
61586157
6158+ if (drm_dp_dpcd_read(immediate_upstream_aux,
6159+ DP_DSC_SUPPORT, &upstream_dsc, 1) != 1)
6160+ return NULL;
6161+
6162+ if (!(upstream_dsc & DP_DSC_DECOMPRESSION_IS_SUPPORTED))
6163+ return NULL;
6164+
61596165 if (drm_dp_read_dpcd_caps(immediate_upstream_aux, dpcd_ext) < 0)
61606166 return NULL;
61616167
drivers/gpu/drm/display/drm_hdmi_state_helper.c+1−3
@@ -521,8 +521,6 @@ int drm_atomic_helper_connector_hdmi_check(struct drm_connector *connector, · 520 unmodified lines
521521 }
522522 EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_check);
523523
524−#define HDMI_MAX_INFOFRAME_SIZE 29
525−
526524 static int clear_device_infoframe(struct drm_connector *connector,
527525 enum hdmi_infoframe_type type)
528526 {
@@ -563,7 +561,7 @@ static int write_device_infoframe(struct drm_connector *connector, · 34 unmodified lines
563561 {
564562 const struct drm_connector_hdmi_funcs *funcs = connector->hdmi.funcs;
565563 struct drm_device *dev = connector->dev;
566− u8 buffer[HDMI_MAX_INFOFRAME_SIZE];
564+ u8 buffer[HDMI_INFOFRAME_SIZE(MAX)];
567565 int ret;
568566 int len;
569567
drivers/gpu/drm/drm_atomic_uapi.c+1−1
@@ -543,7 +543,7 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, · 542 unmodified lines
543543 &state->fb_damage_clips,
544544 val,
545545 -1,
546− sizeof(struct drm_rect),
546+ sizeof(struct drm_mode_rect),
547547 &replaced);
548548 return ret;
549549 } else if (property == plane->scaling_filter_property) {
drivers/gpu/drm/drm_debugfs.c+1−3
@@ -520,8 +520,6 @@ static const struct file_operations drm_connector_fops = { · 519 unmodified lines
520520 .write = connector_write
521521 };
522522
523−#define HDMI_MAX_INFOFRAME_SIZE 29
524−
525523 static ssize_t
526524 audio_infoframe_read(struct file *filp, char __user *ubuf, size_t count, loff_t *ppos)
527525 {
@@ -579,7 +577,7 @@ static ssize_t _f##_read_infoframe(struct file *filp, \ · 51 unmodified lines
579577 struct drm_connector *connector; \
580578 union hdmi_infoframe *frame; \
581579 struct drm_device *dev; \
582− u8 buf[HDMI_MAX_INFOFRAME_SIZE]; \
580+ u8 buf[HDMI_INFOFRAME_SIZE(MAX)]; \
583581 ssize_t len = 0; \
584582 \
585583 connector = filp->private_data; \
drivers/gpu/drm/panthor/panthor_sched.c+14−2
@@ -3242,6 +3242,18 @@ int panthor_group_destroy(struct panthor_file *pfile, u32 group_handle) · 3241 unmodified lines
32423242 return 0;
32433243 }
32443244
3245+static struct panthor_group *group_from_handle(struct panthor_group_pool *pool,
3246+ u32 group_handle)
3247+{
3248+ struct panthor_group *group;
3249+
3250+ xa_lock(&pool->xa);
3251+ group = group_get(xa_load(&pool->xa, group_handle));
3252+ xa_unlock(&pool->xa);
3253+
3254+ return group;
3255+}
3256+
32453257 int panthor_group_get_state(struct panthor_file *pfile,
32463258 struct drm_panthor_group_get_state *get_state)
32473259 {
@@ -3253,7 +3265,7 @@ int panthor_group_get_state(struct panthor_file *pfile, · 5 unmodified lines
32533265 if (get_state->pad)
32543266 return -EINVAL;
32553267
3256− group = group_get(xa_load(&gpool->xa, get_state->group_handle));
3268+ group = group_from_handle(gpool, get_state->group_handle);
32573269 if (!group)
32583270 return -EINVAL;
32593271
@@ -3384,7 +3396,7 @@ panthor_job_create(struct panthor_file *pfile, · 124 unmodified lines
33843396 job->call_info.latest_flush = qsubmit->latest_flush;
33853397 INIT_LIST_HEAD(&job->node);
33863398
3387− job->group = group_get(xa_load(&gpool->xa, group_handle));
3399+ job->group = group_from_handle(gpool, group_handle);
33883400 if (!job->group) {
33893401 ret = -EINVAL;
33903402 goto err_put_job;
drivers/gpu/drm/scheduler/sched_entity.c+2−2
@@ -380,7 +380,7 @@ static void drm_sched_entity_wakeup(struct dma_fence *f, · 379 unmodified lines
380380 container_of(cb, struct drm_sched_entity, cb);
381381
382382 drm_sched_entity_clear_dep(f, cb);
383− drm_sched_wakeup(entity->rq->sched, entity);
383+ drm_sched_wakeup(entity->rq->sched);
384384 }
385385
386386 /**
@@ -612,7 +612,7 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job) · 225 unmodified lines
612612 if (drm_sched_policy == DRM_SCHED_POLICY_FIFO)
613613 drm_sched_rq_update_fifo(entity, submit_ts);
614614
615− drm_sched_wakeup(entity->rq->sched, entity);
615+ drm_sched_wakeup(entity->rq->sched);
616616 }
617617 }
618618 EXPORT_SYMBOL(drm_sched_entity_push_job);
drivers/gpu/drm/scheduler/sched_main.c+2−5
@@ -1013,15 +1013,12 @@ EXPORT_SYMBOL(drm_sched_job_cleanup); · 1012 unmodified lines
10131013 /**
10141014 * drm_sched_wakeup - Wake up the scheduler if it is ready to queue
10151015 * @sched: scheduler instance
1016− * @entity: the scheduler entity
10171016 *
10181017 * Wake up the scheduler if we can queue jobs.
10191018 */
1020−void drm_sched_wakeup(struct drm_gpu_scheduler *sched,
1021− struct drm_sched_entity *entity)
1019+void drm_sched_wakeup(struct drm_gpu_scheduler *sched)
10221020 {
1023− if (drm_sched_can_queue(sched, entity))
1024− drm_sched_run_job_queue(sched);
1021+ drm_sched_run_job_queue(sched);
10251022 }
10261023
10271024 /**
drivers/gpu/drm/vboxvideo/hgsmi_base.c+9−1
@@ -139,7 +139,15 @@ int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags, · 138 unmodified lines
139139 flags |= VBOX_MOUSE_POINTER_VISIBLE;
140140 }
141141
142− p = hgsmi_buffer_alloc(ctx, sizeof(*p) + pixel_len, HGSMI_CH_VBVA,
142+ /*
143+ * The 4 extra bytes come from switching struct vbva_mouse_pointer_shape
144+ * from having a 4 bytes fixed array at the end to using a proper VLA
145+ * at the end. These 4 extra bytes were not subtracted from sizeof(*p)
146+ * before the switch to the VLA, so this way the behavior is unchanged.
147+ * Chances are these 4 extra bytes are not necessary but they are kept
148+ * to avoid regressions.
149+ */
150+ p = hgsmi_buffer_alloc(ctx, sizeof(*p) + pixel_len + 4, HGSMI_CH_VBVA,
143151 VBVA_MOUSE_POINTER_SHAPE);
144152 if (!p)
145153 return -ENOMEM;
drivers/gpu/drm/vboxvideo/vboxvideo.h+1−3
@@ -351,10 +351,8 @@ struct vbva_mouse_pointer_shape { · 350 unmodified lines
351351 * Bytes in the gap between the AND and the XOR mask are undefined.
352352 * XOR mask scanlines have no gap between them and size of XOR mask is:
353353 * xor_len = width * 4 * height.
354− *
355− * Preallocate 4 bytes for accessing actual data as p->data.
356354 */
357− u8 data[4];
355+ u8 data[];
358356 } __packed;
359357
360358 /* pointer is visible */
include/drm/gpu_scheduler.h+1−1
@@ -574,7 +574,7 @@ void drm_sched_entity_modify_sched(struct drm_sched_entity *entity, · 573 unmodified lines
574574
575575 void drm_sched_tdr_queue_imm(struct drm_gpu_scheduler *sched);
576576 void drm_sched_job_cleanup(struct drm_sched_job *job);
577−void drm_sched_wakeup(struct drm_gpu_scheduler *sched, struct drm_sched_entity *entity);
577+void drm_sched_wakeup(struct drm_gpu_scheduler *sched);
578578 bool drm_sched_wqueue_ready(struct drm_gpu_scheduler *sched);
579579 void drm_sched_wqueue_stop(struct drm_gpu_scheduler *sched);
580580 void drm_sched_wqueue_start(struct drm_gpu_scheduler *sched);
include/linux/hdmi.h+9−0
@@ -59,6 +59,15 @@ enum hdmi_infoframe_type { · 58 unmodified lines
5959 #define HDMI_DRM_INFOFRAME_SIZE 26
6060 #define HDMI_VENDOR_INFOFRAME_SIZE 4
6161
62+/*
63+ * HDMI 1.3a table 5-14 states that the largest InfoFrame_length is 27,
64+ * not including the packet header or checksum byte. We include the
65+ * checksum byte in HDMI_INFOFRAME_HEADER_SIZE, so this should allow
66+ * HDMI_INFOFRAME_SIZE(MAX) to be the largest buffer we could ever need
67+ * for any HDMI infoframe.
68+ */
69+#define HDMI_MAX_INFOFRAME_SIZE 27
70+
6271 #define HDMI_INFOFRAME_SIZE(type) \
6372 (HDMI_INFOFRAME_HEADER_SIZE + HDMI_ ## type ## _INFOFRAME_SIZE)
6473