• J
    media: ov6650: Fix some format attributes not under control · 122d97d4
    Janusz Krzysztofik 提交于
    commit 1c6a2b63095154bbf9e8f38d79487a728331bf65 upstream.
    
    User arguments passed to .get/set_fmt() pad operation callbacks may
    contain unsupported values.  The driver takes control over frame size
    and pixel code as well as colorspace and field attributes but has never
    cared for remainig format attributes, i.e., ycbcr_enc, quantization
    and xfer_func, introduced by commit 11ff030c ("[media]
    v4l2-mediabus: improve colorspace support").  Fix it.
    
    Set up a static v4l2_mbus_framefmt structure with attributes
    initialized to reasonable defaults and use it for updating content of
    user provided arguments.  In case of V4L2_SUBDEV_FORMAT_ACTIVE,
    postpone frame size update, now performed from inside ov6650_s_fmt()
    helper, util the user argument is first updated in ov6650_set_fmt() with
    default frame format content.  For V4L2_SUBDEV_FORMAT_TRY, don't copy
    all attributes to pad config, only those handled by the driver, then
    fill the response with the default frame format updated with resulting
    pad config format code and frame size.
    
    Fixes: 11ff030c ("[media] v4l2-mediabus: improve colorspace support")
    Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
    Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
    Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    122d97d4
ov6650.c 27.0 KB