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 v3 4/4] tools/intel_hdcp: Fix flickering when changing HDCP state
Date: Mon, 13 Apr 2026 16:36:29 -0700 [thread overview]
Message-ID: <20260413233629.771034-5-John.Harrison@Igalia.com> (raw)
In-Reply-To: <20260413233629.771034-1-John.Harrison@Igalia.com>
The menu system would redraw the screen with a special colour to
denote the current HDCP status after a change was requested. However,
the screen was immediately redrawn by the player thread with a
background colour denoting the requested HDCP level. So all you
actually got was a very brief full screen flicker of the background
colour.
As the current HDCP status is now being shown as a separate line of
text in the video player's output, there is no need to use the screen
background to show the same. So, drop the menu updates once the video
player is running to remove the flickering.
Also, don't stop the video player thread when HDCP is disabled so that
the status update continues (given that the menu thread is no longer
redrawing the screen now).
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 | 34 +++++-----------------------------
1 file changed, 5 insertions(+), 29 deletions(-)
diff --git a/tools/intel_hdcp.c b/tools/intel_hdcp.c
index c12de06df..448d2e36d 100644
--- a/tools/intel_hdcp.c
+++ b/tools/intel_hdcp.c
@@ -102,24 +102,13 @@ static void draw_menu_text(cairo_t *cr, data_t *data)
}
}
-static void draw_menu(data_t *data, const char *status)
+static void draw_menu(data_t *data)
{
cairo_t *cr = igt_get_cairo_ctx(data->fd, &data->fb);
- /* Background color and text color based on HDCP status */
- if (strcmp(status, "INIT") == 0) {
- cairo_set_source_rgb(cr, 0.051, 0.278, 0.631);
- cairo_paint(cr);
- cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
- } else if (strcmp(status, "Enabled") == 0) {
- cairo_set_source_rgb(cr, 0.0, 1.0, 0.0);
- cairo_paint(cr);
- cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
- } else {
- cairo_set_source_rgb(cr, 1.0, 0.0, 0.0);
- cairo_paint(cr);
- cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
- }
+ cairo_set_source_rgb(cr, 0.051, 0.278, 0.631);
+ cairo_paint(cr);
+ cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
draw_menu_text(cr, data);
@@ -666,13 +655,12 @@ int main(int argc, char **argv)
{
data_t data;
pthread_t tid;
- const char *status = NULL;
igt_plane_t *primary;
data.selected_connector = -1;
test_init(&data);
- draw_menu(&data, "INIT");
+ draw_menu(&data);
primary = igt_output_get_plane_type(data.output, DRM_PLANE_TYPE_PRIMARY);
igt_plane_set_fb(primary, &data.fb);
igt_display_commit2(&data.display, COMMIT_ATOMIC);
@@ -706,7 +694,6 @@ int main(int argc, char **argv)
enable_hdcp_type(&data, HDCP_TYPE_2_2_TYPE_1);
break;
case 5:
- stop_video_player(&data);
set_hdcp_prop(&data, CP_UNDESIRED, HDCP_TYPE_2_2_TYPE_1,
data.selected_connector);
data.hdcp_type = HDCP_TYPE_NONE;
@@ -715,17 +702,6 @@ int main(int argc, char **argv)
break;
}
- if (cmd == 1) {
- draw_menu(&data, "INIT");
- } else {
- status = get_hdcp_status(&data, data.selected_connector);
- draw_menu(&data, status);
- }
-
- primary = igt_output_get_plane_type(data.output, DRM_PLANE_TYPE_PRIMARY);
- igt_plane_set_fb(primary, &data.fb);
- igt_display_commit2(&data.display, COMMIT_ATOMIC);
-
usleep(200 * 1000);
}
--
2.43.0
next prev parent reply other threads:[~2026-04-13 23:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-13 23:36 [PATCH i-g-t v3 0/4] tool/intel_hdcp: Fix flickering and show actual HDCP status John Harrison
2026-04-13 23:36 ` [PATCH i-g-t v3 1/4] tools/intel_hdcp: Fix status rendering John Harrison
2026-04-14 15:55 ` Kamil Konieczny
2026-04-13 23:36 ` [PATCH i-g-t v3 2/4] tools/intel_hdcp: Move text rendering into helper function John Harrison
2026-04-14 16:03 ` Kamil Konieczny
2026-04-13 23:36 ` [PATCH i-g-t v3 3/4] tools/intel_hdcp: Show actual HDCP status John Harrison
2026-04-14 2:55 ` Kandpal, Suraj
2026-04-14 16:04 ` Kamil Konieczny
2026-04-13 23:36 ` John Harrison [this message]
2026-04-14 2:56 ` [PATCH i-g-t v3 4/4] tools/intel_hdcp: Fix flickering when changing HDCP state Kandpal, Suraj
2026-04-14 2:55 ` ✓ Xe.CI.BAT: success for tool/intel_hdcp: Fix flickering and show actual HDCP status (rev3) Patchwork
2026-04-14 3:01 ` ✓ i915.CI.BAT: " Patchwork
2026-04-14 6:50 ` ✓ Xe.CI.FULL: " Patchwork
2026-04-14 9:35 ` ✓ i915.CI.Full: " Patchwork
2026-04-14 16:48 ` [PATCH i-g-t v3 0/4] tool/intel_hdcp: Fix flickering and show actual HDCP status Kamil Konieczny
2026-04-14 17:06 ` 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=20260413233629.771034-5-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