• Hugues Fruchet's avatar
    media: stm32-dcmi: g_/s_selection crop support · d533d501
    Hugues Fruchet authored
    Implements g_/s_selection crop support by using DCMI crop
    hardware feature.
    User can first get the maximum supported resolution of the sensor
    by calling g_selection(V4L2_SEL_TGT_CROP_BOUNDS).
    Then user call to s_selection(V4L2_SEL_TGT_CROP) will reset sensor
    to its maximum resolution and crop request is saved for later usage
    in s_fmt().
    Next call to s_fmt() will check if sensor can do frame size request
    with crop request. If sensor supports only discrete frame sizes,
    the frame size which is larger than user request is selected in
    order to be able to match the crop request. Then s_fmt() resolution
    user request is adjusted to match crop request resolution.
    Signed-off-by: default avatarHugues Fruchet <hugues.fruchet@st.com>
    Signed-off-by: default avatarHans Verkuil <hansverk@cisco.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
    d533d501
stm32-dcmi.c 42.5 KB