• Janusz Krzysztofik's avatar
    media: ov6650: Add try support to selection API operations · c7405264
    Janusz Krzysztofik authored
    Try requests are now only supported by format processing pad operations
    implemented by the driver.  The driver selection API operations
    currently respond to them with -EINVAL.  While that is correct, it
    constraints video device drivers to not use subdevice cropping at all
    while processing user requested active frame size, otherwise their set
    try format results might differ from active.  As a consequence, we
    can't fix set format pad operation as not to touch crop rectangle since
    that would affect users not being able to set arbitrary frame sizes.
    Moreover, without a working set try selection support we are not able
    to use pad config crop rectangle as a reference while processing set
    try format requests.
    
    Implement missing try selection support.  Moreover, as it will be now
    possible to maintain the pad config crop rectangle via selection API,
    start using it instead of the active one as a reference while
    processing set try format requests.
    
    is_unscaled_ok() helper, now also called from set selection operation,
    has been just moved up in the source file to avoid a prototype, with no
    functional changes.
    
    [Sakari Ailus: Rebase on subdev state patches]
    
    Fixes: 717fd5b4 ("[media] v4l2: replace try_mbus_fmt by set_fmt")
    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@kernel.org>
    c7405264
ov6650.c 28 KB