aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-04-22 18:52:54 -0400
committerDave Airlie <airlied@redhat.com>2018-04-22 18:52:54 -0400
commite1898f99b7b8668c589e5eae8bd3d0d572ef5835 (patch)
tree88df30ed3cdb70891385db05728ca510a25fa8a4 /drivers
parenta10beabba213924d876f2d10ca9351aeab93f58a (diff)
parent7eb2c4dd54ff841f2fe509a84973eb25fa20bda2 (diff)
Merge tag 'drm-misc-fixes-2018-04-18-1' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-fixes: stable: vc4: Fix memory leak during BO teardown (Daniel) dp: Add i2c retry for LSPCON adapters (Imre) hdcp: Fix device count mask (Ramalingam) Cc: Daniel J Blueman <daniel@quora.org Cc: Imre Deak <imre.deak@intel.com> Cc: Ramalingam C <ramalingam.c@intel.com> * tag 'drm-misc-fixes-2018-04-18-1' of git://anongit.freedesktop.org/drm/drm-misc: drm/i915: Fix LSPCON TMDS output buffer enabling from low-power state drm: Fix HDCP downstream dev count read drm/vc4: Fix memory leak during BO teardown
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/drm_dp_dual_mode_helper.c39
-rw-r--r--drivers/gpu/drm/vc4/vc4_bo.c2
-rw-r--r--drivers/gpu/drm/vc4/vc4_validate_shaders.c1
3 files changed, 35 insertions, 7 deletions
diff --git a/drivers/gpu/drm/drm_dp_dual_mode_helper.c b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
index 02a50929af67..e7f4fe2848a5 100644
--- a/drivers/gpu/drm/drm_dp_dual_mode_helper.c
+++ b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
@@ -350,19 +350,44 @@ int drm_dp_dual_mode_set_tmds_output(enum drm_dp_dual_mode_type type,
350{ 350{
351 uint8_t tmds_oen = enable ? 0 : DP_DUAL_MODE_TMDS_DISABLE; 351 uint8_t tmds_oen = enable ? 0 : DP_DUAL_MODE_TMDS_DISABLE;
352 ssize_t ret; 352 ssize_t ret;
353 int retry;
353 354
354 if (type < DRM_DP_DUAL_MODE_TYPE2_DVI) 355 if (type < DRM_DP_DUAL_MODE_TYPE2_DVI)
355 return 0; 356 return 0;
356 357
357 ret = drm_dp_dual_mode_write(adapter, DP_DUAL_MODE_TMDS_OEN, 358 /*
358 &tmds_oen, sizeof(tmds_oen)); 359 * LSPCON adapters in low-power state may ignore the first write, so
359 if (ret) { 360 * read back and verify the written value a few times.
360 DRM_DEBUG_KMS("Failed to %s TMDS output buffers\n", 361 */
361 enable ? "enable" : "disable"); 362 for (retry = 0; retry < 3; retry++) {
362 return ret; 363 uint8_t tmp;
364
365 ret = drm_dp_dual_mode_write(adapter, DP_DUAL_MODE_TMDS_OEN,
366 &tmds_oen, sizeof(tmds_oen));
367 if (ret) {
368 DRM_DEBUG_KMS("Failed to %s TMDS output buffers (%d attempts)\n",
369 enable ? "enable" : "disable",
370 retry + 1);
371 return ret;
372 }
373
374 ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_TMDS_OEN,
375 &tmp, sizeof(tmp));
376 if (ret) {
377 DRM_DEBUG_KMS("I2C read failed during TMDS output buffer %s (%d attempts)\n",
378 enable ? "enabling" : "disabling",
379 retry + 1);
380 return ret;
381 }
382
383 if (tmp == tmds_oen)
384 return 0;
363 } 385 }
364 386
365 return 0; 387 DRM_DEBUG_KMS("I2C write value mismatch during TMDS output buffer %s\n",
388 enable ? "enabling" : "disabling");
389
390 return -EIO;
366} 391}
367EXPORT_SYMBOL(drm_dp_dual_mode_set_tmds_output); 392EXPORT_SYMBOL(drm_dp_dual_mode_set_tmds_output);
368 393
diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c
index 2decc8e2c79f..add9cc97a3b6 100644
--- a/drivers/gpu/drm/vc4/vc4_bo.c
+++ b/drivers/gpu/drm/vc4/vc4_bo.c
@@ -195,6 +195,7 @@ static void vc4_bo_destroy(struct vc4_bo *bo)
195 vc4_bo_set_label(obj, -1); 195 vc4_bo_set_label(obj, -1);
196 196
197 if (bo->validated_shader) { 197 if (bo->validated_shader) {
198 kfree(bo->validated_shader->uniform_addr_offsets);
198 kfree(bo->validated_shader->texture_samples); 199 kfree(bo->validated_shader->texture_samples);
199 kfree(bo->validated_shader); 200 kfree(bo->validated_shader);
200 bo->validated_shader = NULL; 201 bo->validated_shader = NULL;
@@ -591,6 +592,7 @@ void vc4_free_object(struct drm_gem_object *gem_bo)
591 } 592 }
592 593
593 if (bo->validated_shader) { 594 if (bo->validated_shader) {
595 kfree(bo->validated_shader->uniform_addr_offsets);
594 kfree(bo->validated_shader->texture_samples); 596 kfree(bo->validated_shader->texture_samples);
595 kfree(bo->validated_shader); 597 kfree(bo->validated_shader);
596 bo->validated_shader = NULL; 598 bo->validated_shader = NULL;
diff --git a/drivers/gpu/drm/vc4/vc4_validate_shaders.c b/drivers/gpu/drm/vc4/vc4_validate_shaders.c
index d3f15bf60900..7cf82b071de2 100644
--- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c
+++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c
@@ -942,6 +942,7 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj)
942fail: 942fail:
943 kfree(validation_state.branch_targets); 943 kfree(validation_state.branch_targets);
944 if (validated_shader) { 944 if (validated_shader) {
945 kfree(validated_shader->uniform_addr_offsets);
945 kfree(validated_shader->texture_samples); 946 kfree(validated_shader->texture_samples);
946 kfree(validated_shader); 947 kfree(validated_shader);
947 } 948 }