From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@intel.com>,
Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
Ashutosh Dixit <ashutosh.dixit@intel.com>,
Karthik B S <karthik.b.s@intel.com>,
Kamil Konieczny <kamil.konieczny@linux.intel.com>
Subject: [PATCH i-g-t v3] scripts: Add new script for verbatim sync with kernel
Date: Fri, 15 May 2026 12:22:08 +0200 [thread overview]
Message-ID: <20260515102209.11275-1-kamil.konieczny@linux.intel.com> (raw)
From: Jani Nikula <jani.nikula@intel.com>
This is a helper script used in cases when a verbatim kernel
file should be copied into igt-dev.
v3: removed 'Author:' as this is in git history (Jani)
updated commit hash to match last pciids.h sync (Kamil)
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
scripts/sync_with_kernel.sh | 55 +++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
create mode 100755 scripts/sync_with_kernel.sh
diff --git a/scripts/sync_with_kernel.sh b/scripts/sync_with_kernel.sh
new file mode 100755
index 000000000..469e3edd8
--- /dev/null
+++ b/scripts/sync_with_kernel.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+# SPDX-License-Identifier: MIT
+#
+# Copyright © 2026 Intel Corporation
+#
+# Use this for verbatim copies from kernel into igt-dev-tools
+# Change paths to yours, update the repos, cd to IGT, and run.
+
+SINCE=e68a60f9e6a6
+KERNEL=$HOME/src/linux
+IGT=$HOME/src/intel-gpu-tools
+
+declare -g -A map
+map["drivers/gpu/drm/i915/display/intel_vbt_defs.h"]="tools/intel_vbt_defs.h"
+map["drivers/gpu/drm/i915/display/intel_dsi_vbt_defs.h"]="tools/intel_dsi_vbt_defs.h"
+map["include/drm/intel/pciids.h"]="lib/pciids.h"
+
+cd $KERNEL
+
+for infile in "${!map[@]}"; do
+ outfile=${map[$infile]}
+
+ echo "processing $infile -> $outfile"
+
+ last=
+ for commit in $(git log --reverse --pretty=%h $SINCE..HEAD -- $infile); do
+ if ! git cat-file -e $commit:$infile 2>/dev/null; then
+ continue
+ fi
+ if git show $commit:$infile | diff -q $IGT/$outfile - >/dev/null; then
+ last=$commit
+ break
+ fi
+ done
+
+ if [[ -z "$last" ]]; then
+ echo "last update to $infile not found"
+ continue
+ fi
+
+ for commit in $(git log --reverse --pretty=%h $last..HEAD -- $infile); do
+ prefix="${outfile%.*}"
+ base="$(basename $outfile)"
+ # ref=$(git cite $commit)
+ # alias: cite = log -1 --abbrev=12 '--format=%h (\"%s\")'
+ ref=$(git log -1 --abbrev=12 '--format=%h (\"%s\")' $commit)
+ git show $commit:$infile > $IGT/$outfile
+ cd $IGT
+ git commit -as \
+ -m "${prefix}: sync ${base} with kernel commit $commit" \
+ -m "Synchronize ${base} with kernel commit:" \
+ -m "$ref"
+ cd -
+ done
+done
--
2.54.0
reply other threads:[~2026-05-15 10:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260515102209.11275-1-kamil.konieczny@linux.intel.com \
--to=kamil.konieczny@linux.intel.com \
--cc=ankit.k.nautiyal@intel.com \
--cc=ashutosh.dixit@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=karthik.b.s@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