Skip to content

Commit

Permalink
Merge tag 'drm-misc-fixes-2018-04-18-1' of git://anongit.freedesktop.…
Browse files Browse the repository at this point in the history
…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 <[email protected]
Cc: Imre Deak <[email protected]>
Cc: Ramalingam C <[email protected]>

* 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
  • Loading branch information
airlied committed Apr 22, 2018
2 parents a10beab + 7eb2c4d commit e1898f9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
39 changes: 32 additions & 7 deletions drivers/gpu/drm/drm_dp_dual_mode_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,19 +350,44 @@ int drm_dp_dual_mode_set_tmds_output(enum drm_dp_dual_mode_type type,
{
uint8_t tmds_oen = enable ? 0 : DP_DUAL_MODE_TMDS_DISABLE;
ssize_t ret;
int retry;

if (type < DRM_DP_DUAL_MODE_TYPE2_DVI)
return 0;

ret = drm_dp_dual_mode_write(adapter, DP_DUAL_MODE_TMDS_OEN,
&tmds_oen, sizeof(tmds_oen));
if (ret) {
DRM_DEBUG_KMS("Failed to %s TMDS output buffers\n",
enable ? "enable" : "disable");
return ret;
/*
* LSPCON adapters in low-power state may ignore the first write, so
* read back and verify the written value a few times.
*/
for (retry = 0; retry < 3; retry++) {
uint8_t tmp;

ret = drm_dp_dual_mode_write(adapter, DP_DUAL_MODE_TMDS_OEN,
&tmds_oen, sizeof(tmds_oen));
if (ret) {
DRM_DEBUG_KMS("Failed to %s TMDS output buffers (%d attempts)\n",
enable ? "enable" : "disable",
retry + 1);
return ret;
}

ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_TMDS_OEN,
&tmp, sizeof(tmp));
if (ret) {
DRM_DEBUG_KMS("I2C read failed during TMDS output buffer %s (%d attempts)\n",
enable ? "enabling" : "disabling",
retry + 1);
return ret;
}

if (tmp == tmds_oen)
return 0;
}

return 0;
DRM_DEBUG_KMS("I2C write value mismatch during TMDS output buffer %s\n",
enable ? "enabling" : "disabling");

return -EIO;
}
EXPORT_SYMBOL(drm_dp_dual_mode_set_tmds_output);

Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/vc4/vc4_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ static void vc4_bo_destroy(struct vc4_bo *bo)
vc4_bo_set_label(obj, -1);

if (bo->validated_shader) {
kfree(bo->validated_shader->uniform_addr_offsets);
kfree(bo->validated_shader->texture_samples);
kfree(bo->validated_shader);
bo->validated_shader = NULL;
Expand Down Expand Up @@ -591,6 +592,7 @@ void vc4_free_object(struct drm_gem_object *gem_bo)
}

if (bo->validated_shader) {
kfree(bo->validated_shader->uniform_addr_offsets);
kfree(bo->validated_shader->texture_samples);
kfree(bo->validated_shader);
bo->validated_shader = NULL;
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/vc4/vc4_validate_shaders.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj)
fail:
kfree(validation_state.branch_targets);
if (validated_shader) {
kfree(validated_shader->uniform_addr_offsets);
kfree(validated_shader->texture_samples);
kfree(validated_shader);
}
Expand Down
2 changes: 1 addition & 1 deletion include/drm/drm_hdcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define DRM_HDCP_RI_LEN 2
#define DRM_HDCP_V_PRIME_PART_LEN 4
#define DRM_HDCP_V_PRIME_NUM_PARTS 5
#define DRM_HDCP_NUM_DOWNSTREAM(x) (x & 0x3f)
#define DRM_HDCP_NUM_DOWNSTREAM(x) (x & 0x7f)
#define DRM_HDCP_MAX_CASCADE_EXCEEDED(x) (x & BIT(3))
#define DRM_HDCP_MAX_DEVICE_EXCEEDED(x) (x & BIT(7))

Expand Down

0 comments on commit e1898f9

Please sign in to comment.