[v9,02/13] drm: Add reference counting on HDR metadata blob

Submitted by Shankar, Uma on May 8, 2019, 6:38 p.m.

Details

Message ID 1557340733-9629-3-git-send-email-uma.shankar@intel.com
State New
Headers show
Series "Add HDR Metadata Parsing and handling in DRM layer" ( rev: 9 ) in DRI devel

Commit Message

Shankar, Uma May 8, 2019, 6:38 p.m.
From: Jonas Karlman <jonas@kwiboo.se>

This adds reference count for HDR metadata blob,
handled as part of duplicate and destroy connector
state functions.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
---
 drivers/gpu/drm/drm_atomic_state_helper.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
index ac929f6..8f49952 100644
--- a/drivers/gpu/drm/drm_atomic_state_helper.c
+++ b/drivers/gpu/drm/drm_atomic_state_helper.c
@@ -391,6 +391,10 @@  void drm_atomic_helper_connector_reset(struct drm_connector *connector)
 		drm_connector_get(connector);
 	state->commit = NULL;
 
+	if (state->hdr_output_metadata)
+		drm_property_blob_get(state->hdr_output_metadata);
+	state->hdr_metadata_changed = false;
+
 	/* Don't copy over a writeback job, they are used only once */
 	state->writeback_job = NULL;
 }
@@ -438,6 +442,8 @@  struct drm_connector_state *
 
 	if (state->writeback_job)
 		drm_writeback_cleanup_job(state->writeback_job);
+
+	drm_property_blob_put(state->hdr_output_metadata);
 }
 EXPORT_SYMBOL(__drm_atomic_helper_connector_destroy_state);