public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Mun, Gwan-gyeong" <gwan-gyeong.mun@intel.com>
To: "Hiler, Arkadiusz" <arkadiusz.hiler@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"Vetter, Daniel" <daniel.vetter@intel.com>,
	"C, Ramalingam" <ramalingam.c@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t v6 7/8] kms_content_protection: SRM Testing
Date: Thu, 16 May 2019 11:35:20 +0000	[thread overview]
Message-ID: <b3175af41f86f681c62abb133da32222d6cee294.camel@intel.com> (raw)
In-Reply-To: <20190502131625.27551-8-ramalingam.c@intel.com>

On Thu, 2019-05-02 at 18:46 +0530, Ramalingam C wrote:
> Since we dont any uAPI to retrieve the downstream's device's ksv,
> we can't check the real revocation through SRM.
> 
> This test just writes the facsimile SRM into the /lib/firmware/
> and check the kernel parsing of it by invoking the hdc
> authentication.
> 
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  tests/kms_content_protection.c | 44
> ++++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> diff --git a/tests/kms_content_protection.c
> b/tests/kms_content_protection.c
> index cc8abda48702..f440358c29c5 100644
> --- a/tests/kms_content_protection.c
> +++ b/tests/kms_content_protection.c
> @@ -65,6 +65,12 @@ struct data {
>  #define KERNEL_DISABLE_TIME_ALLOWED_MSEC	(1 * 1000)
>  #define FLIP_EVENT_POLLING_TIMEOUT_MSEC		1000
>  
> +__u8 facsimile_srm[] = {
> +	0x80, 0x0, 0x0, 0x05, 0x01, 0x0, 0x0, 0x36, 0x02, 0x51, 0x1E,
> 0xF2,
> +	0x1A, 0xCD, 0xE7, 0x26, 0x97, 0xF4, 0x01, 0x97, 0x10, 0x19,
> 0x92, 0x53,
> +	0xE9, 0xF0, 0x59, 0x95, 0xA3, 0x7A, 0x3B, 0xFE, 0xE0, 0x9C,
> 0x76, 0xDD,
> +	0x83, 0xAA, 0xC2, 0x5B, 0x24, 0xB3, 0x36, 0x84, 0x94, 0x75,
> 0x34, 0xDB,
> +	0x10, 0x9E, 0x3B, 0x23, 0x13, 0xD8, 0x7A, 0xC2, 0x30, 0x79,
> 0x84};
>  
>  static void flip_handler(int fd, unsigned int sequence, unsigned int
> tv_sec,
>  			 unsigned int tv_usec, void *_data)
> @@ -420,6 +426,26 @@ static void test_cp_lic(igt_output_t *output)
>  	igt_assert_f(!ret, "Content Protection LIC Failed\n");
>  }
>  
> +static bool write_srm_as_fw(const __u8 *srm, int len)
> +{
> +	int fd, ret, total = 0;
> +
> +	fd = open("/lib/firmware/display_hdcp_srm.bin", O_WRONLY |
> O_CREAT);
When I built it on Arch Linux, it shown below error message.

In file included from /usr/include/fcntl.h:328,
                 from ../tests/kms_content_protection.c:26:
In function ‘open’,
    inlined from ‘write_srm_as_fw.constprop’ at
../tests/kms_content_protection.c:435:7,
    inlined from ‘__real_main622’ at
../tests/kms_content_protection.c:687:9:
/usr/include/bits/fcntl2.h:50:4: error: call to ‘__open_missing_mode’
declared with attribute error: open with O_CREAT or O_TMPFILE in second
argument needs 3 arguments
    __open_missing_mode ();
    ^~~~~~~~~~~~~~~~~~~~~~


> +	do {
> +		ret = write(fd, srm + total, len - total);
> +		if (ret < 0)
> +			ret = -errno;
> +		if (ret == -EINTR || ret == -EAGAIN)
> +			continue;
> +		if (ret <= 0)
> +			break;
> +		total += ret;
> +	} while (total != len);
> +	close(fd);
> +
> +	return total < len ? false : true;
> +}
> +
>  static void test_content_protection_on_output(igt_output_t *output,
>  					      enum igt_commit_style s,
>  					      int content_type)
> @@ -638,6 +664,24 @@ igt_main
>  		test_content_protection(COMMIT_ATOMIC,
> HDCP_CONTENT_TYPE_0);
>  	}
>  
> +	/*
> +	 *  Testing the revocation check through SRM needs a HDCP sink
> with
> +	 *  programmable Ksvs or we need a uAPI from kernel to read the
> +	 *  connected HDCP sink's Ksv. With that we would be able to
> add that
> +	 *  Ksv into a SRM and send in for revocation check. Since we
> dont have
> +	 *  either of these options, we test SRM writing from userspace
> and
> +	 *  validation of the same at kernel. Something is better than
> nothing.
> +	 */
> +	igt_subtest("srm") {
> +		bool ret;
> +
> +		igt_require(data.display.is_atomic);
> +		ret = write_srm_as_fw((const __u8 *)facsimile_srm,
> +				      sizeof(facsimile_srm));
> +		igt_assert_f(ret, "SRM update failed");
> +		test_content_protection(COMMIT_ATOMIC,
> HDCP_CONTENT_TYPE_0);
> +	}
> +
>  	igt_fixture
>  		igt_display_fini(&data.display);
>  }
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-05-16 11:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-02 13:16 [igt-dev] [PATCH i-g-t v6 0/8] HDCP2.2 Tests Ramalingam C
2019-05-02 13:16 ` [igt-dev] [PATCH i-g-t v6 1/8] kms_content_protection: Tests are defined by flags Ramalingam C
2019-05-06  6:01   ` Shankar, Uma
2019-05-06  6:26     ` Ramalingam C
2019-05-06  9:53       ` Shankar, Uma
2019-05-02 13:16 ` [igt-dev] [PATCH i-g-t v6 2/8] kms_content_protection: Link Integrity Check subtest Ramalingam C
2019-05-06  6:07   ` Shankar, Uma
2019-05-06  6:27     ` Ramalingam C
2019-05-02 13:16 ` [igt-dev] [PATCH i-g-t v6 3/8] kms_content_protection: Content type support Ramalingam C
2019-05-06 11:00   ` Shankar, Uma
2019-05-02 13:16 ` [igt-dev] [PATCH i-g-t v6 4/8] kms_content_protection: test teardown and rebuild of I915-mei I/F Ramalingam C
2019-05-06 11:09   ` Shankar, Uma
2019-05-02 13:16 ` [igt-dev] [PATCH i-g-t v6 5/8] kms_content_protection: test content type change Ramalingam C
2019-05-06 11:25   ` Shankar, Uma
2019-05-02 13:16 ` [igt-dev] [PATCH i-g-t v6 6/8] kms_content_protection: uevent for HDCP status change Ramalingam C
2019-05-02 13:16 ` [igt-dev] [PATCH i-g-t v6 7/8] kms_content_protection: SRM Testing Ramalingam C
2019-05-06 11:40   ` Shankar, Uma
2019-05-16 11:35   ` Mun, Gwan-gyeong [this message]
2019-05-02 13:16 ` [igt-dev] [PATCH i-g-t v6 8/8] DO NOT MERGE: CP in fast feedback list Ramalingam C
2019-05-02 14:13 ` [igt-dev] ✓ Fi.CI.BAT: success for HDCP2.2 Tests (rev6) Patchwork
2019-05-02 17:14 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=b3175af41f86f681c62abb133da32222d6cee294.camel@intel.com \
    --to=gwan-gyeong.mun@intel.com \
    --cc=arkadiusz.hiler@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=ramalingam.c@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