History

Merge tag 'drm-fixes-2019-08-16' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie: "Nothing too crazy this week, one amdgpu fix to use vmalloc for a struct that grew in size, and another MST fix for nouveau, and some other misc fixes: i915: - single GVT use after free fix scheduler: - entity destruction race fix amdgpu: - struct allocation fix - gfx9 soft recovery fix nouveau: - followup MST fix ast: - vga register race fix" * tag 'drm-fixes-2019-08-16' of git://anongit.freedesktop.org/drm/drm: drm/nouveau: Only recalculate PBN/VCPI on mode/connector changes drm/ast: Fixed reboot test may cause system hanged drm/scheduler: use job count instead of peek drm/amd/display: use kvmalloc for dc_state (v2) drm/amdgpu: fix gfx9 soft recovery drm/i915: Use after free in error path in intel_vgpu_create_workload()

Linus Torvalds committed 7 years ago

Commit ec037ac2 parents a69e905 a85abd58 files · +30 −22Browse files

Unified · Split

8 files
  1. drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 −1
  2. drivers/gpu/drm/amd/display/dc/core/dc.c +6 −5
  3. drivers/gpu/drm/ast/ast_main.c +4 −1
  4. drivers/gpu/drm/ast/ast_mode.c +1 −1
  5. drivers/gpu/drm/ast/ast_post.c +1 −1
  6. drivers/gpu/drm/i915/gvt/scheduler.c +2 −2
  7. drivers/gpu/drm/nouveau/dispnv50/disp.c +13 −9
  8. drivers/gpu/drm/scheduler/sched_entity.c +2 −2
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c+1−1
@@ -4869,7 +4869,7 @@ static void gfx_v9_0_ring_soft_recovery(struct amdgpu_ring *ring, unsigned vmid) · 4868 unmodified lines
48694869 value = REG_SET_FIELD(value, SQ_CMD, MODE, 0x01);
48704870 value = REG_SET_FIELD(value, SQ_CMD, CHECK_VMID, 1);
48714871 value = REG_SET_FIELD(value, SQ_CMD, VM_ID, vmid);
4872− WREG32(mmSQ_CMD, value);
4872+ WREG32_SOC15(GC, 0, mmSQ_CMD, value);
48734873 }
48744874
48754875 static void gfx_v9_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,
drivers/gpu/drm/amd/display/dc/core/dc.c+6−5
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 */
2424
2525 #include <linux/slab.h>
26+#include <linux/mm.h>
2627
2728 #include "dm_services.h"
2829
@@ -1171,8 +1172,8 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc) · 1142 unmodified lines
11711172
11721173 struct dc_state *dc_create_state(struct dc *dc)
11731174 {
1174− struct dc_state *context = kzalloc(sizeof(struct dc_state),
1175− GFP_KERNEL);
1175+ struct dc_state *context = kvzalloc(sizeof(struct dc_state),
1176+ GFP_KERNEL);
11761177
11771178 if (!context)
11781179 return NULL;
@@ -1192,11 +1193,11 @@ struct dc_state *dc_create_state(struct dc *dc) · 13 unmodified lines
11921193 struct dc_state *dc_copy_state(struct dc_state *src_ctx)
11931194 {
11941195 int i, j;
1195− struct dc_state *new_ctx = kmemdup(src_ctx,
1196− sizeof(struct dc_state), GFP_KERNEL);
1196+ struct dc_state *new_ctx = kvmalloc(sizeof(struct dc_state), GFP_KERNEL);
11971197
11981198 if (!new_ctx)
11991199 return NULL;
1200+ memcpy(new_ctx, src_ctx, sizeof(struct dc_state));
12001201
12011202 for (i = 0; i < MAX_PIPES; i++) {
12021203 struct pipe_ctx *cur_pipe = &new_ctx->res_ctx.pipe_ctx[i];
@@ -1230,7 +1231,7 @@ static void dc_state_free(struct kref *kref) · 27 unmodified lines
12301231 {
12311232 struct dc_state *context = container_of(kref, struct dc_state, refcount);
12321233 dc_resource_state_destruct(context);
1233− kfree(context);
1234+ kvfree(context);
12341235 }
12351236
12361237 void dc_release_state(struct dc_state *context)
drivers/gpu/drm/ast/ast_main.c+4−1
@@ -131,8 +131,8 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post) · 130 unmodified lines
131131
132132
133133 /* Enable extended register access */
134− ast_enable_mmio(dev);
135134 ast_open_key(ast);
135+ ast_enable_mmio(dev);
136136
137137 /* Find out whether P2A works or whether to use device-tree */
138138 ast_detect_config_mode(dev, &scu_rev);
@@ -576,6 +576,9 @@ void ast_driver_unload(struct drm_device *dev) · 437 unmodified lines
576576 {
577577 struct ast_private *ast = dev->dev_private;
578578
579+ /* enable standard VGA decode */
580+ ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x04);
581+
579582 ast_release_firmware(dev);
580583 kfree(ast->dp501_fw_addr);
581584 ast_mode_fini(dev);
drivers/gpu/drm/ast/ast_mode.c+1−1
@@ -604,7 +604,7 @@ static int ast_crtc_mode_set(struct drm_crtc *crtc, · 603 unmodified lines
604604 return -EINVAL;
605605 ast_open_key(ast);
606606
607− ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa1, 0xff, 0x04);
607+ ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06);
608608
609609 ast_set_std_reg(crtc, adjusted_mode, &vbios_mode);
610610 ast_set_crtc_reg(crtc, adjusted_mode, &vbios_mode);
drivers/gpu/drm/ast/ast_post.c+1−1
@@ -46,7 +46,7 @@ void ast_enable_mmio(struct drm_device *dev) · 45 unmodified lines
4646 {
4747 struct ast_private *ast = dev->dev_private;
4848
49− ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa1, 0xff, 0x04);
49+ ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06);
5050 }
5151
5252
drivers/gpu/drm/i915/gvt/scheduler.c+2−2
@@ -1528,9 +1528,9 @@ intel_vgpu_create_workload(struct intel_vgpu *vgpu, int ring_id, · 1527 unmodified lines
15281528 if (!intel_gvt_ggtt_validate_range(vgpu,
15291529 workload->wa_ctx.indirect_ctx.guest_gma,
15301530 workload->wa_ctx.indirect_ctx.size)) {
1531− kmem_cache_free(s->workloads, workload);
15321531 gvt_vgpu_err("invalid wa_ctx at: 0x%lx\n",
15331532 workload->wa_ctx.indirect_ctx.guest_gma);
1533+ kmem_cache_free(s->workloads, workload);
15341534 return ERR_PTR(-EINVAL);
15351535 }
15361536 }
@@ -1542,9 +1542,9 @@ intel_vgpu_create_workload(struct intel_vgpu *vgpu, int ring_id, · 5 unmodified lines
15421542 if (!intel_gvt_ggtt_validate_range(vgpu,
15431543 workload->wa_ctx.per_ctx.guest_gma,
15441544 CACHELINE_BYTES)) {
1545− kmem_cache_free(s->workloads, workload);
15461545 gvt_vgpu_err("invalid per_ctx at: 0x%lx\n",
15471546 workload->wa_ctx.per_ctx.guest_gma);
1547+ kmem_cache_free(s->workloads, workload);
15481548 return ERR_PTR(-EINVAL);
15491549 }
15501550 }
drivers/gpu/drm/nouveau/dispnv50/disp.c+13−9
@@ -771,16 +771,20 @@ nv50_msto_atomic_check(struct drm_encoder *encoder, · 770 unmodified lines
771771 struct nv50_head_atom *asyh = nv50_head_atom(crtc_state);
772772 int slots;
773773
774− /* When restoring duplicated states, we need to make sure that the
775− * bw remains the same and avoid recalculating it, as the connector's
776− * bpc may have changed after the state was duplicated
777− */
778− if (!state->duplicated)
779− asyh->dp.pbn =
780− drm_dp_calc_pbn_mode(crtc_state->adjusted_mode.clock,
781− connector->display_info.bpc * 3);
774+ if (crtc_state->mode_changed || crtc_state->connectors_changed) {
775+ /*
776+ * When restoring duplicated states, we need to make sure that
777+ * the bw remains the same and avoid recalculating it, as the
778+ * connector's bpc may have changed after the state was
779+ * duplicated
780+ */
781+ if (!state->duplicated) {
782+ const int bpp = connector->display_info.bpc * 3;
783+ const int clock = crtc_state->adjusted_mode.clock;
784+
785+ asyh->dp.pbn = drm_dp_calc_pbn_mode(clock, bpp);
786+ }
782787
783− if (crtc_state->mode_changed) {
784788 slots = drm_dp_atomic_find_vcpi_slots(state, &mstm->mgr,
785789 mstc->port,
786790 asyh->dp.pbn);
drivers/gpu/drm/scheduler/sched_entity.c+2−2
@@ -95,7 +95,7 @@ static bool drm_sched_entity_is_idle(struct drm_sched_entity *entity) · 94 unmodified lines
9595 rmb(); /* for list_empty to work without lock */
9696
9797 if (list_empty(&entity->list) ||
98− spsc_queue_peek(&entity->job_queue) == NULL)
98+ spsc_queue_count(&entity->job_queue) == 0)
9999 return true;
100100
101101 return false;
@@ -281,7 +281,7 @@ void drm_sched_entity_fini(struct drm_sched_entity *entity) · 179 unmodified lines
281281 /* Consumption of existing IBs wasn't completed. Forcefully
282282 * remove them here.
283283 */
284− if (spsc_queue_peek(&entity->job_queue)) {
284+ if (spsc_queue_count(&entity->job_queue)) {
285285 if (sched) {
286286 /* Park the kernel for a moment to make sure it isn't processing
287287 * our enity.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t