• Janusz Krzysztofik's avatar
    media: ov6650: Fix some format attributes not under control · 1c6a2b63
    Janusz Krzysztofik authored
    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: default avatarJanusz Krzysztofik <jmkrzyszt@gmail.com>
    Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
    1c6a2b63
ov6650.c 27 KB