media: mediatek: vcodec: Make decoder capability fields fit requirements
This partially reverts commita8a7a278c5
, and changes things so that the capability string fields of the decoder conform to their requirements. This recent change caused ChromeOS's decoder to no longer function. This is due to ChromeOS using the driver name field to match the video device with its accompanying media device. After the change, they no longer matched. The driver name field should contain the actual driver name, not some otherwise unused string macro from the driver. To make this clear, copy the name from the driver's name field. The card name for the video decoder previously held a static platform name that was fixed to match MT8173. This obviously doesn't make sense for newer chips. Since commita8a7a278c5
("media: mediatek: vcodec: Change decoder v4l2 capability value"), this field was changed to hold the driver's name, or "mtk-vcodec-dec". This doesn't make much sense either, since this still doesn't reflect what chip this is. Instead, fill in the card name with "MTxxxx video decoder" with the proper chip number. Since commitf2d8b6917f
("media: v4l: ioctl: Set bus_info in v4l_querycap()"), the V4L2 core provides a default value for the bus_info field for platform and PCI devices. This value will match the default value for media devices added by commitcef699749f
("media: mc: Set bus_info in media_device_init()"). These defaults are stable and device-specific. Drop the custom capability bus_info from the mtk-vcodec decoder driver, and use the defaults. This also fixes the long standing issue where the media device used for the stateless decoder didn't have its bus_info set, and would never match its accompanying video device. Fixes:a8a7a278c5
("media: mediatek: vcodec: Change decoder v4l2 capability value") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
b464763cc3
commit
620a14e672
|
@ -234,11 +234,12 @@ static int mtk_vcodec_dec_get_chip_name(void *priv)
|
|||
static int vidioc_vdec_querycap(struct file *file, void *priv,
|
||||
struct v4l2_capability *cap)
|
||||
{
|
||||
struct mtk_vcodec_ctx *ctx = fh_to_ctx(priv);
|
||||
struct device *dev = &ctx->dev->plat_dev->dev;
|
||||
int platform_name = mtk_vcodec_dec_get_chip_name(priv);
|
||||
|
||||
strscpy(cap->driver, MTK_VCODEC_DRV_NAME, sizeof(cap->driver));
|
||||
strscpy(cap->card, MTK_VCODEC_DEC_NAME, sizeof(cap->card));
|
||||
snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:mt%d-dec", platform_name);
|
||||
strscpy(cap->driver, dev->driver->name, sizeof(cap->driver));
|
||||
snprintf(cap->card, sizeof(cap->card), "MT%d video decoder", platform_name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue