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
181Bridge Connector Helper181Bridge Connector Helper
182-----------------------182-----------------------
183 183
184.. kernel-doc:: drivers/gpu/drm/drm_bridge_connector.c184.. kernel-doc:: drivers/gpu/drm/display/drm_bridge_connector.c
185 :doc: overview185 :doc: overview
186 186
187 187
@@ -204,7 +204,7 @@ MIPI-DSI bridge operation · 16 unmodified lines
204Bridge Connector Helper Reference204Bridge Connector Helper Reference
205---------------------------------205---------------------------------
206 206
207.. kernel-doc:: drivers/gpu/drm/drm_bridge_connector.c207.. kernel-doc:: drivers/gpu/drm/display/drm_bridge_connector.c
208 :export:208 :export:
209 209
210Panel-Bridge Helper Reference210Panel-Bridge Helper Reference
MAINTAINERS+2−0
@@ -7832,6 +7832,8 @@ F: drivers/gpu/drm/xlnx/ · 7831 unmodified lines
7832DRM GPU SCHEDULER7832DRM GPU SCHEDULER
7833M: Luben Tuikov <ltuikov89@gmail.com>7833M: Luben Tuikov <ltuikov89@gmail.com>
7834M: Matthew Brost <matthew.brost@intel.com>7834M: Matthew Brost <matthew.brost@intel.com>
7835M: Danilo Krummrich <dakr@kernel.org>
7836M: Philipp Stanner <pstanner@redhat.com>
7835L: dri-devel@lists.freedesktop.org7837L: dri-devel@lists.freedesktop.org
7836S: Maintained7838S: Maintained
7837T: git https://gitlab.freedesktop.org/drm/misc/kernel.git7839T: 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
67void sysfb_disable(struct device *dev)67void sysfb_disable(struct device *dev)
68{68{
69 struct screen_info *si = &screen_info;69 struct screen_info *si = &screen_info;
70 struct device *parent;
70 71
71 mutex_lock(&disable_lock);72 mutex_lock(&disable_lock);
72 if (!dev || dev == sysfb_parent_dev(si)) {73 parent = sysfb_parent_dev(si);
74 if (!dev || !parent || dev == parent) {
73 sysfb_unregister();75 sysfb_unregister();
74 disabled = true;76 disabled = true;
75 }77 }
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
6083 struct drm_dp_aux *immediate_upstream_aux;6083 struct drm_dp_aux *immediate_upstream_aux;
6084 struct drm_dp_mst_port *fec_port;6084 struct drm_dp_mst_port *fec_port;
6085 struct drm_dp_desc desc = {};6085 struct drm_dp_desc desc = {};
6086 u8 upstream_dsc;
6086 u8 endpoint_fec;6087 u8 endpoint_fec;
6087 u8 endpoint_dsc;6088 u8 endpoint_dsc;
6088 6089
@@ -6109,8 +6110,6 @@ struct drm_dp_aux *drm_dp_mst_dsc_aux_for_port(struct drm_dp_mst_port *port) · 20 unmodified lines
6109 6110
6110 /* DP-to-DP peer device */6111 /* DP-to-DP peer device */
6111 if (drm_dp_mst_is_virtual_dpcd(immediate_upstream_port)) {6112 if (drm_dp_mst_is_virtual_dpcd(immediate_upstream_port)) {
6112 u8 upstream_dsc;
6113
6114 if (drm_dp_dpcd_read(&port->aux,6113 if (drm_dp_dpcd_read(&port->aux,
6115 DP_DSC_SUPPORT, &endpoint_dsc, 1) != 1)6114 DP_DSC_SUPPORT, &endpoint_dsc, 1) != 1)
6116 return NULL;6115 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
6156 if (drm_dp_has_quirk(&desc, DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD)) {6155 if (drm_dp_has_quirk(&desc, DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD)) {
6157 u8 dpcd_ext[DP_RECEIVER_CAP_SIZE];6156 u8 dpcd_ext[DP_RECEIVER_CAP_SIZE];
6158 6157
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
6159 if (drm_dp_read_dpcd_caps(immediate_upstream_aux, dpcd_ext) < 0)6165 if (drm_dp_read_dpcd_caps(immediate_upstream_aux, dpcd_ext) < 0)
6160 return NULL;6166 return NULL;
6161 6167
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
521}521}
522EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_check);522EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_check);
523 523
524#define HDMI_MAX_INFOFRAME_SIZE 29
525
526static int clear_device_infoframe(struct drm_connector *connector,524static int clear_device_infoframe(struct drm_connector *connector,
527 enum hdmi_infoframe_type type)525 enum hdmi_infoframe_type type)
528{526{
@@ -563,7 +561,7 @@ static int write_device_infoframe(struct drm_connector *connector, · 34 unmodified lines
563{561{
564 const struct drm_connector_hdmi_funcs *funcs = connector->hdmi.funcs;562 const struct drm_connector_hdmi_funcs *funcs = connector->hdmi.funcs;
565 struct drm_device *dev = connector->dev;563 struct drm_device *dev = connector->dev;
566 u8 buffer[HDMI_MAX_INFOFRAME_SIZE];564 u8 buffer[HDMI_INFOFRAME_SIZE(MAX)];
567 int ret;565 int ret;
568 int len;566 int len;
569 567
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
543 &state->fb_damage_clips,543 &state->fb_damage_clips,
544 val,544 val,
545 -1,545 -1,
546 sizeof(struct drm_rect),546 sizeof(struct drm_mode_rect),
547 &replaced);547 &replaced);
548 return ret;548 return ret;
549 } else if (property == plane->scaling_filter_property) {549 } 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
520 .write = connector_write520 .write = connector_write
521};521};
522 522
523#define HDMI_MAX_INFOFRAME_SIZE 29
524
525static ssize_t523static ssize_t
526audio_infoframe_read(struct file *filp, char __user *ubuf, size_t count, loff_t *ppos)524audio_infoframe_read(struct file *filp, char __user *ubuf, size_t count, loff_t *ppos)
527{525{
@@ -579,7 +577,7 @@ static ssize_t _f##_read_infoframe(struct file *filp, \ · 51 unmodified lines
579 struct drm_connector *connector; \577 struct drm_connector *connector; \
580 union hdmi_infoframe *frame; \578 union hdmi_infoframe *frame; \
581 struct drm_device *dev; \579 struct drm_device *dev; \
582 u8 buf[HDMI_MAX_INFOFRAME_SIZE]; \580 u8 buf[HDMI_INFOFRAME_SIZE(MAX)]; \
583 ssize_t len = 0; \581 ssize_t len = 0; \
584 \582 \
585 connector = filp->private_data; \583 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
3242 return 0;3242 return 0;
3243}3243}
3244 3244
3245static 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
3245int panthor_group_get_state(struct panthor_file *pfile,3257int panthor_group_get_state(struct panthor_file *pfile,
3246 struct drm_panthor_group_get_state *get_state)3258 struct drm_panthor_group_get_state *get_state)
3247{3259{
@@ -3253,7 +3265,7 @@ int panthor_group_get_state(struct panthor_file *pfile, · 5 unmodified lines
3253 if (get_state->pad)3265 if (get_state->pad)
3254 return -EINVAL;3266 return -EINVAL;
3255 3267
3256 group = group_get(xa_load(&gpool->xa, get_state->group_handle));3268 group = group_from_handle(gpool, get_state->group_handle);
3257 if (!group)3269 if (!group)
3258 return -EINVAL;3270 return -EINVAL;
3259 3271
@@ -3384,7 +3396,7 @@ panthor_job_create(struct panthor_file *pfile, · 124 unmodified lines
3384 job->call_info.latest_flush = qsubmit->latest_flush;3396 job->call_info.latest_flush = qsubmit->latest_flush;
3385 INIT_LIST_HEAD(&job->node);3397 INIT_LIST_HEAD(&job->node);
3386 3398
3387 job->group = group_get(xa_load(&gpool->xa, group_handle));3399 job->group = group_from_handle(gpool, group_handle);
3388 if (!job->group) {3400 if (!job->group) {
3389 ret = -EINVAL;3401 ret = -EINVAL;
3390 goto err_put_job;3402 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
380 container_of(cb, struct drm_sched_entity, cb);380 container_of(cb, struct drm_sched_entity, cb);
381 381
382 drm_sched_entity_clear_dep(f, cb);382 drm_sched_entity_clear_dep(f, cb);
383 drm_sched_wakeup(entity->rq->sched, entity);383 drm_sched_wakeup(entity->rq->sched);
384}384}
385 385
386/**386/**
@@ -612,7 +612,7 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job) · 225 unmodified lines
612 if (drm_sched_policy == DRM_SCHED_POLICY_FIFO)612 if (drm_sched_policy == DRM_SCHED_POLICY_FIFO)
613 drm_sched_rq_update_fifo(entity, submit_ts);613 drm_sched_rq_update_fifo(entity, submit_ts);
614 614
615 drm_sched_wakeup(entity->rq->sched, entity);615 drm_sched_wakeup(entity->rq->sched);
616 }616 }
617}617}
618EXPORT_SYMBOL(drm_sched_entity_push_job);618EXPORT_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
1013/**1013/**
1014 * drm_sched_wakeup - Wake up the scheduler if it is ready to queue1014 * drm_sched_wakeup - Wake up the scheduler if it is ready to queue
1015 * @sched: scheduler instance1015 * @sched: scheduler instance
1016 * @entity: the scheduler entity
1017 *1016 *
1018 * Wake up the scheduler if we can queue jobs.1017 * Wake up the scheduler if we can queue jobs.
1019 */1018 */
1020void drm_sched_wakeup(struct drm_gpu_scheduler *sched,1019void drm_sched_wakeup(struct drm_gpu_scheduler *sched)
1021 struct drm_sched_entity *entity)
1022{1020{
1023 if (drm_sched_can_queue(sched, entity))1021 drm_sched_run_job_queue(sched);
1024 drm_sched_run_job_queue(sched);
1025}1022}
1026 1023
1027/**1024/**
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
139 flags |= VBOX_MOUSE_POINTER_VISIBLE;139 flags |= VBOX_MOUSE_POINTER_VISIBLE;
140 }140 }
141 141
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,
143 VBVA_MOUSE_POINTER_SHAPE);151 VBVA_MOUSE_POINTER_SHAPE);
144 if (!p)152 if (!p)
145 return -ENOMEM;153 return -ENOMEM;
drivers/gpu/drm/vboxvideo/vboxvideo.h+1−3
@@ -351,10 +351,8 @@ struct vbva_mouse_pointer_shape { · 350 unmodified lines
351 * Bytes in the gap between the AND and the XOR mask are undefined.351 * Bytes in the gap between the AND and the XOR mask are undefined.
352 * XOR mask scanlines have no gap between them and size of XOR mask is:352 * XOR mask scanlines have no gap between them and size of XOR mask is:
353 * xor_len = width * 4 * height.353 * xor_len = width * 4 * height.
354 *
355 * Preallocate 4 bytes for accessing actual data as p->data.
356 */354 */
357 u8 data[4];355 u8 data[];
358} __packed;356} __packed;
359 357
360/* pointer is visible */358/* 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
574 574
575void drm_sched_tdr_queue_imm(struct drm_gpu_scheduler *sched);575void drm_sched_tdr_queue_imm(struct drm_gpu_scheduler *sched);
576void drm_sched_job_cleanup(struct drm_sched_job *job);576void drm_sched_job_cleanup(struct drm_sched_job *job);
577void drm_sched_wakeup(struct drm_gpu_scheduler *sched, struct drm_sched_entity *entity);577void drm_sched_wakeup(struct drm_gpu_scheduler *sched);
578bool drm_sched_wqueue_ready(struct drm_gpu_scheduler *sched);578bool drm_sched_wqueue_ready(struct drm_gpu_scheduler *sched);
579void drm_sched_wqueue_stop(struct drm_gpu_scheduler *sched);579void drm_sched_wqueue_stop(struct drm_gpu_scheduler *sched);
580void drm_sched_wqueue_start(struct drm_gpu_scheduler *sched);580void 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
59#define HDMI_DRM_INFOFRAME_SIZE 2659#define HDMI_DRM_INFOFRAME_SIZE 26
60#define HDMI_VENDOR_INFOFRAME_SIZE 460#define HDMI_VENDOR_INFOFRAME_SIZE 4
61 61
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
62#define HDMI_INFOFRAME_SIZE(type) \71#define HDMI_INFOFRAME_SIZE(type) \
63 (HDMI_INFOFRAME_HEADER_SIZE + HDMI_ ## type ## _INFOFRAME_SIZE)72 (HDMI_INFOFRAME_HEADER_SIZE + HDMI_ ## type ## _INFOFRAME_SIZE)
64 73