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>
Unified · Split
| @@ -181,7 +181,7 @@ Bridge Operations · 180 unmodified lines | ||
| 181 | 181 | Bridge Connector Helper |
| 182 | 182 | ----------------------- |
| 183 | 183 | |
| 184 | −.. kernel-doc:: drivers/gpu/drm/drm_bridge_connector.c | |
| 184 | +.. kernel-doc:: drivers/gpu/drm/display/drm_bridge_connector.c | |
| 185 | 185 | :doc: overview |
| 186 | 186 | |
| 187 | 187 | |
| @@ -204,7 +204,7 @@ MIPI-DSI bridge operation · 16 unmodified lines | ||
| 204 | 204 | Bridge Connector Helper Reference |
| 205 | 205 | --------------------------------- |
| 206 | 206 | |
| 207 | −.. kernel-doc:: drivers/gpu/drm/drm_bridge_connector.c | |
| 207 | +.. kernel-doc:: drivers/gpu/drm/display/drm_bridge_connector.c | |
| 208 | 208 | :export: |
| 209 | 209 | |
| 210 | 210 | Panel-Bridge Helper Reference |
| @@ -7832,6 +7832,8 @@ F: drivers/gpu/drm/xlnx/ · 7831 unmodified lines | ||
| 7832 | 7832 | DRM GPU SCHEDULER |
| 7833 | 7833 | M: Luben Tuikov <ltuikov89@gmail.com> |
| 7834 | 7834 | M: Matthew Brost <matthew.brost@intel.com> |
| 7835 | +M: Danilo Krummrich <dakr@kernel.org> | |
| 7836 | +M: Philipp Stanner <pstanner@redhat.com> | |
| 7835 | 7837 | L: dri-devel@lists.freedesktop.org |
| 7836 | 7838 | S: Maintained |
| 7837 | 7839 | T: git https://gitlab.freedesktop.org/drm/misc/kernel.git |
| @@ -67,9 +67,11 @@ static bool sysfb_unregister(void) · 66 unmodified lines | ||
| 67 | 67 | void sysfb_disable(struct device *dev) |
| 68 | 68 | { |
| 69 | 69 | struct screen_info *si = &screen_info; |
| 70 | + struct device *parent; | |
| 70 | 71 | |
| 71 | 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 | 75 | sysfb_unregister(); |
| 74 | 76 | disabled = true; |
| 75 | 77 | } |
| @@ -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 | 6083 | struct drm_dp_aux *immediate_upstream_aux; |
| 6084 | 6084 | struct drm_dp_mst_port *fec_port; |
| 6085 | 6085 | struct drm_dp_desc desc = {}; |
| 6086 | + u8 upstream_dsc; | |
| 6086 | 6087 | u8 endpoint_fec; |
| 6087 | 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 | 6111 | /* DP-to-DP peer device */ |
| 6111 | 6112 | if (drm_dp_mst_is_virtual_dpcd(immediate_upstream_port)) { |
| 6112 | − u8 upstream_dsc; | |
| 6113 | − | |
| 6114 | 6113 | if (drm_dp_dpcd_read(&port->aux, |
| 6115 | 6114 | DP_DSC_SUPPORT, &endpoint_dsc, 1) != 1) |
| 6116 | 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 | 6155 | if (drm_dp_has_quirk(&desc, DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD)) { |
| 6157 | 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 | 6165 | if (drm_dp_read_dpcd_caps(immediate_upstream_aux, dpcd_ext) < 0) |
| 6160 | 6166 | return NULL; |
| 6161 | 6167 | |
| @@ -521,8 +521,6 @@ int drm_atomic_helper_connector_hdmi_check(struct drm_connector *connector, · 520 unmodified lines | ||
| 521 | 521 | } |
| 522 | 522 | EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_check); |
| 523 | 523 | |
| 524 | −#define HDMI_MAX_INFOFRAME_SIZE 29 | |
| 525 | − | |
| 526 | 524 | static int clear_device_infoframe(struct drm_connector *connector, |
| 527 | 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 | 562 | const struct drm_connector_hdmi_funcs *funcs = connector->hdmi.funcs; |
| 565 | 563 | struct drm_device *dev = connector->dev; |
| 566 | − u8 buffer[HDMI_MAX_INFOFRAME_SIZE]; | |
| 564 | + u8 buffer[HDMI_INFOFRAME_SIZE(MAX)]; | |
| 567 | 565 | int ret; |
| 568 | 566 | int len; |
| 569 | 567 | |
| @@ -543,7 +543,7 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, · 542 unmodified lines | ||
| 543 | 543 | &state->fb_damage_clips, |
| 544 | 544 | val, |
| 545 | 545 | -1, |
| 546 | − sizeof(struct drm_rect), | |
| 546 | + sizeof(struct drm_mode_rect), | |
| 547 | 547 | &replaced); |
| 548 | 548 | return ret; |
| 549 | 549 | } else if (property == plane->scaling_filter_property) { |
| @@ -520,8 +520,6 @@ static const struct file_operations drm_connector_fops = { · 519 unmodified lines | ||
| 520 | 520 | .write = connector_write |
| 521 | 521 | }; |
| 522 | 522 | |
| 523 | −#define HDMI_MAX_INFOFRAME_SIZE 29 | |
| 524 | − | |
| 525 | 523 | static ssize_t |
| 526 | 524 | audio_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 | 577 | struct drm_connector *connector; \ |
| 580 | 578 | union hdmi_infoframe *frame; \ |
| 581 | 579 | struct drm_device *dev; \ |
| 582 | − u8 buf[HDMI_MAX_INFOFRAME_SIZE]; \ | |
| 580 | + u8 buf[HDMI_INFOFRAME_SIZE(MAX)]; \ | |
| 583 | 581 | ssize_t len = 0; \ |
| 584 | 582 | \ |
| 585 | 583 | connector = filp->private_data; \ |
| @@ -3242,6 +3242,18 @@ int panthor_group_destroy(struct panthor_file *pfile, u32 group_handle) · 3241 unmodified lines | ||
| 3242 | 3242 | return 0; |
| 3243 | 3243 | } |
| 3244 | 3244 | |
| 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 | + | |
| 3245 | 3257 | int panthor_group_get_state(struct panthor_file *pfile, |
| 3246 | 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 | 3265 | if (get_state->pad) |
| 3254 | 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 | 3269 | if (!group) |
| 3258 | 3270 | return -EINVAL; |
| 3259 | 3271 | |
| @@ -3384,7 +3396,7 @@ panthor_job_create(struct panthor_file *pfile, · 124 unmodified lines | ||
| 3384 | 3396 | job->call_info.latest_flush = qsubmit->latest_flush; |
| 3385 | 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 | 3400 | if (!job->group) { |
| 3389 | 3401 | ret = -EINVAL; |
| 3390 | 3402 | goto err_put_job; |
| @@ -380,7 +380,7 @@ static void drm_sched_entity_wakeup(struct dma_fence *f, · 379 unmodified lines | ||
| 380 | 380 | container_of(cb, struct drm_sched_entity, cb); |
| 381 | 381 | |
| 382 | 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 | 612 | if (drm_sched_policy == DRM_SCHED_POLICY_FIFO) |
| 613 | 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 | } |
| 618 | 618 | EXPORT_SYMBOL(drm_sched_entity_push_job); |
| @@ -1013,15 +1013,12 @@ EXPORT_SYMBOL(drm_sched_job_cleanup); · 1012 unmodified lines | ||
| 1013 | 1013 | /** |
| 1014 | 1014 | * drm_sched_wakeup - Wake up the scheduler if it is ready to queue |
| 1015 | 1015 | * @sched: scheduler instance |
| 1016 | − * @entity: the scheduler entity | |
| 1017 | 1016 | * |
| 1018 | 1017 | * Wake up the scheduler if we can queue jobs. |
| 1019 | 1018 | */ |
| 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) | |
| 1022 | 1020 | { |
| 1023 | − if (drm_sched_can_queue(sched, entity)) | |
| 1024 | − drm_sched_run_job_queue(sched); | |
| 1021 | + drm_sched_run_job_queue(sched); | |
| 1025 | 1022 | } |
| 1026 | 1023 | |
| 1027 | 1024 | /** |
| @@ -139,7 +139,15 @@ int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags, · 138 unmodified lines | ||
| 139 | 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 | 151 | VBVA_MOUSE_POINTER_SHAPE); |
| 144 | 152 | if (!p) |
| 145 | 153 | return -ENOMEM; |
| @@ -351,10 +351,8 @@ struct vbva_mouse_pointer_shape { · 350 unmodified lines | ||
| 351 | 351 | * Bytes in the gap between the AND and the XOR mask are undefined. |
| 352 | 352 | * XOR mask scanlines have no gap between them and size of XOR mask is: |
| 353 | 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 | 356 | } __packed; |
| 359 | 357 | |
| 360 | 358 | /* pointer is visible */ |
| @@ -574,7 +574,7 @@ void drm_sched_entity_modify_sched(struct drm_sched_entity *entity, · 573 unmodified lines | ||
| 574 | 574 | |
| 575 | 575 | void drm_sched_tdr_queue_imm(struct drm_gpu_scheduler *sched); |
| 576 | 576 | 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); | |
| 578 | 578 | bool drm_sched_wqueue_ready(struct drm_gpu_scheduler *sched); |
| 579 | 579 | void drm_sched_wqueue_stop(struct drm_gpu_scheduler *sched); |
| 580 | 580 | void drm_sched_wqueue_start(struct drm_gpu_scheduler *sched); |
| @@ -59,6 +59,15 @@ enum hdmi_infoframe_type { · 58 unmodified lines | ||
| 59 | 59 | #define HDMI_DRM_INFOFRAME_SIZE 26 |
| 60 | 60 | #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 | 71 | #define HDMI_INFOFRAME_SIZE(type) \ |
| 63 | 72 | (HDMI_INFOFRAME_HEADER_SIZE + HDMI_ ## type ## _INFOFRAME_SIZE) |
| 64 | 73 | |