2024-04-03 10:30:51

by Shawn Sung

[permalink] [raw]
Subject: [PATCH v5 1/9] drm/mediatek/uapi: Add DRM_MTK_GEM_CREATE_ENCRYPTED flag

From: "Jason-JH.Lin" <[email protected]>

Add DRM_MTK_GEM_CREATE_ENCRYPTED flag to allow user to allocate
a secure buffer to support secure video path feature.

Signed-off-by: Jason-JH.Lin <[email protected]>
Signed-off-by: Hsiao Chien Sung <[email protected]>
---
include/uapi/drm/mediatek_drm.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/uapi/drm/mediatek_drm.h b/include/uapi/drm/mediatek_drm.h
index b0dea00bacbc4..e9125de3a24ad 100644
--- a/include/uapi/drm/mediatek_drm.h
+++ b/include/uapi/drm/mediatek_drm.h
@@ -54,6 +54,7 @@ struct drm_mtk_gem_map_off {

#define DRM_MTK_GEM_CREATE 0x00
#define DRM_MTK_GEM_MAP_OFFSET 0x01
+#define DRM_MTK_GEM_CREATE_ENCRYPTED 0x02

#define DRM_IOCTL_MTK_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
DRM_MTK_GEM_CREATE, struct drm_mtk_gem_create)
--
2.18.0



2024-04-15 09:32:57

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v5 1/9] drm/mediatek/uapi: Add DRM_MTK_GEM_CREATE_ENCRYPTED flag

Hi,

On Wed, Apr 03, 2024 at 06:26:53PM +0800, Shawn Sung wrote:
> From: "Jason-JH.Lin" <[email protected]>
>
> Add DRM_MTK_GEM_CREATE_ENCRYPTED flag to allow user to allocate
> a secure buffer to support secure video path feature.
>
> Signed-off-by: Jason-JH.Lin <[email protected]>
> Signed-off-by: Hsiao Chien Sung <[email protected]>
> ---
> include/uapi/drm/mediatek_drm.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/uapi/drm/mediatek_drm.h b/include/uapi/drm/mediatek_drm.h
> index b0dea00bacbc4..e9125de3a24ad 100644
> --- a/include/uapi/drm/mediatek_drm.h
> +++ b/include/uapi/drm/mediatek_drm.h
> @@ -54,6 +54,7 @@ struct drm_mtk_gem_map_off {
>
> #define DRM_MTK_GEM_CREATE 0x00
> #define DRM_MTK_GEM_MAP_OFFSET 0x01
> +#define DRM_MTK_GEM_CREATE_ENCRYPTED 0x02
>
> #define DRM_IOCTL_MTK_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
> DRM_MTK_GEM_CREATE, struct drm_mtk_gem_create)

That flag doesn't exist in drm-misc-next, which tree is this based on?

Maxime


Attachments:
(No filename) (1.03 kB)
signature.asc (281.00 B)
Download all attachments

2024-04-16 16:12:22

by Nicolas Dufresne

[permalink] [raw]
Subject: Re: [PATCH v5 1/9] drm/mediatek/uapi: Add DRM_MTK_GEM_CREATE_ENCRYPTED flag

Hi,

Le mercredi 03 avril 2024 à 18:26 +0800, Shawn Sung a écrit :
> From: "Jason-JH.Lin" <[email protected]>
>
> Add DRM_MTK_GEM_CREATE_ENCRYPTED flag to allow user to allocate

Is "ENCRYPTED" a proper naming ? My expectation is that this would hold data in
a PROTECTED memory region but that no cryptographic algorithm will be involved.

Nicolas

> a secure buffer to support secure video path feature.
>
> Signed-off-by: Jason-JH.Lin <[email protected]>
> Signed-off-by: Hsiao Chien Sung <[email protected]>
> ---
> include/uapi/drm/mediatek_drm.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/uapi/drm/mediatek_drm.h b/include/uapi/drm/mediatek_drm.h
> index b0dea00bacbc4..e9125de3a24ad 100644
> --- a/include/uapi/drm/mediatek_drm.h
> +++ b/include/uapi/drm/mediatek_drm.h
> @@ -54,6 +54,7 @@ struct drm_mtk_gem_map_off {
>
> #define DRM_MTK_GEM_CREATE 0x00
> #define DRM_MTK_GEM_MAP_OFFSET 0x01
> +#define DRM_MTK_GEM_CREATE_ENCRYPTED 0x02
>
> #define DRM_IOCTL_MTK_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
> DRM_MTK_GEM_CREATE, struct drm_mtk_gem_create)


2024-04-17 08:37:22

by Jason-JH.Lin

[permalink] [raw]
Subject: Re: [PATCH v5 1/9] drm/mediatek/uapi: Add DRM_MTK_GEM_CREATE_ENCRYPTED flag

On Mon, 2024-04-15 at 11:32 +0200, Maxime Ripard wrote:
> Hi,
>
> On Wed, Apr 03, 2024 at 06:26:53PM +0800, Shawn Sung wrote:
> > From: "Jason-JH.Lin" <[email protected]>
> >
> > Add DRM_MTK_GEM_CREATE_ENCRYPTED flag to allow user to allocate
> > a secure buffer to support secure video path feature.
> >
> > Signed-off-by: Jason-JH.Lin <[email protected]>
> > Signed-off-by: Hsiao Chien Sung <[email protected]>
> > ---
> > include/uapi/drm/mediatek_drm.h | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/include/uapi/drm/mediatek_drm.h
> > b/include/uapi/drm/mediatek_drm.h
> > index b0dea00bacbc4..e9125de3a24ad 100644
> > --- a/include/uapi/drm/mediatek_drm.h
> > +++ b/include/uapi/drm/mediatek_drm.h
> > @@ -54,6 +54,7 @@ struct drm_mtk_gem_map_off {
> >
> > #define DRM_MTK_GEM_CREATE 0x00
> > #define DRM_MTK_GEM_MAP_OFFSET 0x01
> > +#define DRM_MTK_GEM_CREATE_ENCRYPTED 0x02
> >
> > #define DRM_IOCTL_MTK_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
> > DRM_MTK_GEM_CREATE, struct drm_mtk_gem_create)
>
> That flag doesn't exist in drm-misc-next, which tree is this based
> on?
>
I think we missed the patch [1] in this series.
[1]
https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/

I'll add it back at the next version.

Regards,
Jason-JH.Lin

> Maxime

2024-04-17 08:42:13

by Jason-JH.Lin

[permalink] [raw]
Subject: Re: [PATCH v5 1/9] drm/mediatek/uapi: Add DRM_MTK_GEM_CREATE_ENCRYPTED flag

On Tue, 2024-04-16 at 10:19 -0700, Jeffrey Kardatzke wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> I would argue 'restricted' is the proper name since that was what
> was
> settled on for the dma-buf code. :) But you are definitely right
> that this memory is not encrypted.
>
>
> On Tue, Apr 16, 2024 at 7:09 AM Nicolas Dufresne <
> [email protected]> wrote:
> >
> > Hi,
> >
> > Le mercredi 03 avril 2024 à 18:26 +0800, Shawn Sung a écrit :
> > > From: "Jason-JH.Lin" <[email protected]>
> > >
> > > Add DRM_MTK_GEM_CREATE_ENCRYPTED flag to allow user to allocate
> >
> > Is "ENCRYPTED" a proper naming ? My expectation is that this would
> hold data in
> > a PROTECTED memory region but that no cryptographic algorithm will
> be involved.
> >
> > Nicolas
> >
> > > a secure buffer to support secure video path feature.
> > >
> > > Signed-off-by: Jason-JH.Lin <[email protected]>
> > > Signed-off-by: Hsiao Chien Sung <[email protected]>
> > > ---
> > > include/uapi/drm/mediatek_drm.h | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/include/uapi/drm/mediatek_drm.h
> b/include/uapi/drm/mediatek_drm.h
> > > index b0dea00bacbc4..e9125de3a24ad 100644
> > > --- a/include/uapi/drm/mediatek_drm.h
> > > +++ b/include/uapi/drm/mediatek_drm.h
> > > @@ -54,6 +54,7 @@ struct drm_mtk_gem_map_off {
> > >
> > > #define DRM_MTK_GEM_CREATE 0x00
> > > #define DRM_MTK_GEM_MAP_OFFSET 0x01
> > > +#define DRM_MTK_GEM_CREATE_ENCRYPTED 0x02

OK, I'll change this to DRM_MTK_GEM_CREATE_RESTRICTED at the next
version.

Regards,
Jason-JH.Lin

> > >
> > > #define DRM_IOCTL_MTK_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE +
> \
> > > DRM_MTK_GEM_CREATE, struct drm_mtk_gem_create)
> >
> >