public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: John Harrison <John.Harrison@Igalia.com>
To: igt-dev@lists.freedesktop.org
Cc: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>
Subject: [PATCH i-g-t v2 1/2] tool/intel_hdcp: Show actual HDCP status
Date: Mon, 16 Feb 2026 10:43:40 -0800	[thread overview]
Message-ID: <20260216184341.437722-2-John.Harrison@Igalia.com> (raw)
In-Reply-To: <20260216184341.437722-1-John.Harrison@Igalia.com>

The 'video player' showed what the requested HDCP mode was but not the
actual status. The menu system does redraw the screen with a special
colour to denote the status, but that is immediately overwritten by
the player thread. So all you get is a very brief full screen flicker
(to be fixed in next patch).

Instead, add the current HDCP status as an extra text line of the
video player's output so it is permanently visible and clear.

Also, move the enable of HDCP inside the mutex lock with the
internal state change. That way, the newly added 'enabled/desired'
line does not update in advance of the 'requested' line (due to the
video player thread being asynchronous and managing to turn HDCP on
while the menu thread is waiting on the mutex lock).

v2: Split into two patches (review feedback by Kamil)

CC: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>
CC: Suraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: John Harrison <John.Harrison@Igalia.com>
Acked-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
 tools/intel_hdcp.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/tools/intel_hdcp.c b/tools/intel_hdcp.c
index cd5d2b6be..8e29c5e32 100644
--- a/tools/intel_hdcp.c
+++ b/tools/intel_hdcp.c
@@ -482,6 +482,7 @@ static void *video_player_thread(void *arg)
 	char timer_str[32];
 	time_t current_time, elapsed;
 	int minutes, seconds;
+	const char *status = NULL;
 
 	data = (data_t *)arg;
 	cur_type = data->hdcp_type;
@@ -502,6 +503,8 @@ static void *video_player_thread(void *arg)
 			prev_type = cur_type;
 		}
 
+		status = get_hdcp_status(data, data->selected_connector);
+
 		switch (cur_type) {
 		case HDCP_TYPE_1_4:
 			bg_r = 0.0; bg_g = 0.7; bg_b = 0.0;
@@ -544,10 +547,18 @@ static void *video_player_thread(void *arg)
 		cairo_show_text(cr, timer_str);
 
 		/* Draw HDCP status above timer */
+		cairo_set_font_size(cr, font_size);
+		cairo_text_extents(cr, status, &ext);
+		x = data->width - ext.width - 20;
+		y = data->height - ext.height - 20;
+
+		cairo_move_to(cr, x, y);
+		cairo_show_text(cr, status);
+
 		cairo_set_font_size(cr, font_size);
 		cairo_text_extents(cr, hdcp_str, &ext);
 		x = data->width - ext.width - 20;
-		y = data->height - ext.height - 60;
+		y = data->height - ext.height - 120;
 
 		cairo_move_to(cr, x, y);
 		cairo_show_text(cr, hdcp_str);
@@ -605,8 +616,8 @@ static void stop_video_player(data_t *data)
 
 static void enable_hdcp_type(data_t *data, enum hdcp_type type)
 {
-		set_hdcp_prop(data, CP_DESIRED, type, data->selected_connector);
 		pthread_mutex_lock(&data->lock);
+		set_hdcp_prop(data, CP_DESIRED, type, data->selected_connector);
 		data->hdcp_type = type;
 		data->video_start_time = time(NULL);
 		pthread_mutex_unlock(&data->lock);
-- 
2.43.0


  reply	other threads:[~2026-02-16 18:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-16 18:43 [PATCH i-g-t v2 0/2] tool/intel_hdcp: Fix flickering and show actual HDCP status John Harrison
2026-02-16 18:43 ` John Harrison [this message]
2026-02-17  3:00   ` [PATCH i-g-t v2 1/2] tool/intel_hdcp: Show " Kandpal, Suraj
2026-02-17 16:58     ` John Harrison
2026-02-24 19:30       ` Kamil Konieczny
2026-02-24 22:31         ` John Harrison
2026-03-16 19:06           ` Kamil Konieczny
2026-03-23 21:23             ` John Harrison
2026-03-24  4:27               ` Kandpal, Suraj
2026-03-24  4:34                 ` Reddy Guddati, Santhosh
2026-04-10  0:37                 ` John Harrison
2026-04-10 13:32                   ` Kamil Konieczny
2026-04-13  4:59                     ` Kandpal, Suraj
2026-04-13 23:27                       ` John Harrison
2026-02-16 18:43 ` [PATCH i-g-t v2 2/2] tool/intel_hdcp: Fix flickering when changing HDCP state John Harrison
2026-02-17  3:07   ` Kandpal, Suraj
2026-02-17 17:00     ` John Harrison

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260216184341.437722-2-John.Harrison@Igalia.com \
    --to=john.harrison@igalia.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=santhosh.reddy.guddati@intel.com \
    --cc=suraj.kandpal@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox