Keep MEDIA_PAD_FL_INTERNAL for kernel only, for now
Subsystems (2)
Sakari Ailus
maintainercover Keep MEDIA_PAD_FL_INTERNAL for kernel only, for now
Hi all,
These two patches limit the visibility of the INTERNAL pad flag to the kernel as well as disable creating the pads with INTERNAL pad flag so it won't be enumerable via the MC IOCTLs.
These patches (or later versions of the set) will be merged for 7.4 before rc1 and reverted once the rest of the metadata series can be merged.
The patches are compile tested only. Review and testing is welcome.
Sakari Ailus (2):
media: mc: Keep INTERNAL pad flags just for the kernel, for now
media: maxim-serdes: Disable test pattern generator for now
drivers/media/i2c/maxim-serdes/max_des.c | 3 +-- drivers/media/i2c/maxim-serdes/max_ser.c | 3 +-- include/uapi/linux/media.h | 6 ++++++ 3 files changed, 8 insertions(+), 4 deletions(-)
Signature · 1 line
2.47.3
Sakari Ailus
maintainerPATCH 1/2 media: mc: Keep INTERNAL pad flags just for the kernel, for now
Do not expose INTERNAL pads on UAPI as the documentation nor v4l2-compliance changes to support MEDIA_PAD_FL_INTERNAL pads has not yet been merged.
--- include/uapi/linux/media.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/uapi/linux/media.h +6 -0
@@ -208,7 +208,13 @@ struct media_entity_desc {#define MEDIA_PAD_FL_SINK (1U << 0)#define MEDIA_PAD_FL_SOURCE (1U << 1)#define MEDIA_PAD_FL_MUST_CONNECT (1U << 2) +#if defined(__KERNEL__) +/* +* Forgo INTERNAL pads until proper documentation and v4l2-compliance testing is +* merged. +*/ #define MEDIA_PAD_FL_INTERNAL (1U << 3) +#endif /* __KERNEL__ */ struct media_pad_desc {__u32 entity;/* entity ID */
Signature · 1 line
2.47.3
Re: [PATCH 1/2] media: mc: Keep INTERNAL pad flags just for the kernel, for now
Quoted 1 line · Sakari Ailus
Do not expose INTERNAL pads on UAPI as the documentation nor
s/as the/as neither the/
Quoted 2 lines
v4l2-compliance changes to support
MEDIA_PAD_FL_INTERNALpads has not yet been merged.
"have been merged yet"
Quoted 10 lines
Signed-off-by Sakari Ailus <[email protected]>--- include/uapi/linux/media.h | 6 ++++++ 1 file changed, 6 insertions(+)include/uapi/linux/media.h +0
-0
include/uapi/linux/media.h struct media_entity_desc { · line 213
Quoted 6 lines
include/uapi/linux/media.h +3
-0@@ -208,7 +208,13 @@ struct media_entity_desc {#define MEDIA_PAD_FL_SINK (1U << 0)#define MEDIA_PAD_FL_SOURCE (1U << 1)#define MEDIA_PAD_FL_MUST_CONNECT (1U << 2) +#if defined(__KERNEL__) +/* +* Forgo INTERNAL pads until proper documentation and v4l2-compliance testing is
s/is$/are/
Quoted 7 lines
include/uapi/linux/media.h +3
-0+* merged. +*/ #define MEDIA_PAD_FL_INTERNAL (1U << 3) +#endif /* __KERNEL__ */ struct media_pad_desc {__u32 entity;/* entity ID */
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 1/2] media: mc: Keep INTERNAL pad flags just for the kernel, for now
In reply to Sakari AilusQuoted 5 lines · Sakari Ailus
Do not expose INTERNAL pads on UAPI as the documentation nor v4l2-compliance changes to support
MEDIA_PAD_FL_INTERNALpads has not yet been merged.Signed-off-by Sakari Ailus <[email protected]>
Regards,
Hans
Quoted 22 lines
--- include/uapi/linux/media.h | 6 ++++++ 1 file changed, 6 insertions(+)include/uapi/linux/media.h +6
-0@@ -208,7 +208,13 @@ struct media_entity_desc {#define MEDIA_PAD_FL_SINK (1U << 0)#define MEDIA_PAD_FL_SOURCE (1U << 1)#define MEDIA_PAD_FL_MUST_CONNECT (1U << 2) +#if defined(__KERNEL__) +/* +* Forgo INTERNAL pads until proper documentation and v4l2-compliance testing is +* merged. +*/ #define MEDIA_PAD_FL_INTERNAL (1U << 3) +#endif /* __KERNEL__ */ struct media_pad_desc {__u32 entity;/* entity ID */
Sakari Ailus
maintainerPATCH 2/2 media: maxim-serdes: Disable test pattern generator for now
In reply to Sakari AilusDisable the test pattern generator that uses the INTERNAL pad flags for now.
--- drivers/media/i2c/maxim-serdes/max_des.c | 3 +-- drivers/media/i2c/maxim-serdes/max_ser.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/media/i2c/maxim-serdes/max_des.c +1 -2
@@ -137,8 +137,7 @@ static inline unsigned int max_des_phy_to_pad(struct max_des *des,static inline unsigned int max_des_num_pads (struct max_des *des) { -return des->info->num_links + des->info->num_phys + - (des->ops->set_tpg ?1 :0 ); +return des->info->num_links + des->info->num_phys; }static struct max_des_phy *max_des_pad_to_phy (struct max_des *des,u32 pad)
drivers/media/i2c/maxim-serdes/max_ser.c +1 -2
@@ -90,8 +90,7 @@ static inline unsigned int max_ser_phy_to_pad(struct max_ser *ser,static inline unsigned int max_ser_num_pads (struct max_ser *ser) { -return ser->ops->num_phys +MAX_SER_NUM_LINKS + - (ser->ops->set_tpg ?1 :0 ); +return ser->ops->num_phys +MAX_SER_NUM_LINKS ; }static struct max_ser_phy *max_ser_pad_to_phy (struct max_ser *ser,u32 pad)
Signature · 1 line
2.47.3
Re: [PATCH 2/2] media: maxim-serdes: Disable test pattern generator for now
Quoted 14 lines · Sakari Ailus
Disable the test pattern generator that uses the INTERNAL pad flags for now.
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/i2c/maxim-serdes/max_des.c | 3 +-- drivers/media/i2c/maxim-serdes/max_ser.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)drivers/media/i2c/maxim-serdes/max_des.c +0
-0
drivers/media/i2c/maxim-serdes/max_des.c static inline unsigned int max_des_phy_to_pad(struct max_des *des, · line 140
Quoted 6 lines
drivers/media/i2c/maxim-serdes/max_des.c +1
-2@@ -137,8 +137,7 @@ static inline unsigned int max_des_phy_to_pad(struct max_des *des,static inline unsigned int max_des_num_pads (struct max_des *des) { -return des->info->num_links + des->info->num_phys + - (des->ops->set_tpg ?1 :0 ); +return des->info->num_links + des->info->num_phys;
I think you need to add a comment here and also in max_ser.c.
E.g. something like this:
static inline unsigned int max_des_num_pads(struct max_des *des) {
return des->info->num_links + des->info->num_phys; /*
* TODO: once MEDIA_PAD_FL_INTERNAL is enabled in the uAPI we
* can add the TPG pad:
* return des->info->num_links + des->info->num_phys +
* (des->ops->set_tpg ? 1 : 0);
*/
}
That way it is actually recorded in the source why the tpg pad is currently not added and what to do to add it back.
Regards,
Hans
Quoted 17 lines
drivers/media/i2c/maxim-serdes/max_des.c +0
-0}static struct max_des_phy *max_des_pad_to_phy (struct max_des *des,u32 pad)drivers/media/i2c/maxim-serdes/max_ser.c +1
-2@@ -90,8 +90,7 @@ static inline unsigned int max_ser_phy_to_pad(struct max_ser *ser,static inline unsigned int max_ser_num_pads (struct max_ser *ser) { -return ser->ops->num_phys +MAX_SER_NUM_LINKS + - (ser->ops->set_tpg ?1 :0 ); +return ser->ops->num_phys +MAX_SER_NUM_LINKS ; }static struct max_ser_phy *max_ser_pad_to_phy (struct max_ser *ser,u32 pad)
Sakari Ailus
maintainerRe: [PATCH 2/2] media: maxim-serdes: Disable test pattern generator for now
Hi Hans,
Quoted 37 lines · Hans Verkuil
Quoted 14 lines · Sakari Ailus
Disable the test pattern generator that uses the INTERNAL pad flags for now.
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/i2c/maxim-serdes/max_des.c | 3 +-- drivers/media/i2c/maxim-serdes/max_ser.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)drivers/media/i2c/maxim-serdes/max_des.c +0
-0drivers/media/i2c/maxim-serdes/max_des.c static inline unsigned int max_des_phy_to_pad(struct max_des *des, · line 140
Quoted 6 lines
drivers/media/i2c/maxim-serdes/max_des.c +1
-2@@ -137,8 +137,7 @@ static inline unsigned int max_des_phy_to_pad(struct max_des *des,static inline unsigned int max_des_num_pads (struct max_des *des) { -return des->info->num_links + des->info->num_phys + - (des->ops->set_tpg ?1 :0 ); +return des->info->num_links + des->info->num_phys;I think you need to add a comment here and also in
max_ser.c.E.g. something like this:
static inline unsigned int
max_des_num_pads(struct max_des *des){
returndes->info->num_links+des->info->num_phys; /*
* TODO: onceMEDIA_PAD_FL_INTERNALis enabled in the uAPI we
* can add the TPG pad:
* returndes->info->num_links+des->info->num_phys+
* (des->ops->set_tpg? 1 : 0);
*/
}
Quoted 2 lines
That way it is actually recorded in the source why the tpg pad is currently not added and what to do to add it back.
I'm adding the reverts of the two patches to my metadata series. I can add a comment here, too, if you wish.
Signature · 3 lines
Regards, Sakari Ailus