Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V4L2: support for P010 (HDR) video format for UVC devices #6451

Open
wants to merge 1 commit into
base: rpi-6.6.y
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions drivers/media/common/uvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ static const struct uvc_format_desc uvc_fmts[] = {
.guid = UVC_GUID_FORMAT_M420,
.fcc = V4L2_PIX_FMT_M420,
},
{
.guid = UVC_GUID_FORMAT_P010,
.fcc = V4L2_PIX_FMT_P010,
},
{
.guid = UVC_GUID_FORMAT_UYVY,
.fcc = V4L2_PIX_FMT_UYVY,
Expand Down
3 changes: 3 additions & 0 deletions drivers/media/usb/uvc/uvc_v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ static u32 uvc_v4l2_get_bytesperline(const struct uvc_format *format,
case V4L2_PIX_FMT_M420:
return frame->wWidth;

case V4L2_PIX_FMT_P010:
return frame->wWidth * 2;

default:
return format->bpp * frame->wWidth / 8;
}
Expand Down
3 changes: 3 additions & 0 deletions include/linux/usb/uvc.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@
#define UVC_GUID_FORMAT_M420 \
{ 'M', '4', '2', '0', 0x00, 0x00, 0x10, 0x00, \
0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
#define UVC_GUID_FORMAT_P010 \
{ 'P', '0', '1', '0', 0x00, 0x00, 0x10, 0x00, \
0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}

#define UVC_GUID_FORMAT_H264 \
{ 'H', '2', '6', '4', 0x00, 0x00, 0x10, 0x00, \
Expand Down