[v10 02/12] drm: Add reference counting on HDR metadata blob

Uma Shankar
2019-05-14T17:36:24Z

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(+)

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);

--
1.9.1