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

Small fixes #3

Closed
wants to merge 8 commits into from
Closed
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__pycache__
venv
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ ignore = ['E741', 'E501'] # TODO: fix E501

[tool.ruff.lint.flake8-quotes]
inline-quotes = 'single'
multiline-quotes = 'single'

[tool.ruff.format]
quote-style = 'single'
5 changes: 0 additions & 5 deletions utils/cam-configs/am62.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

imx219_w = 640
Expand Down Expand Up @@ -60,7 +58,6 @@
{
'entity': 'j721e-csi2rx',
'fmt': fmt_pix_imx219,
'embedded': False,
},
],

Expand Down Expand Up @@ -100,7 +97,6 @@
'entity': 'rp1-cfe-csi2-ch1',
'fmt': meta_fmt_pix_imx219,
'embedded': True,
'display': True,
},
],

Expand Down Expand Up @@ -153,7 +149,6 @@
{
'entity': '30102000.ticsi2rx context 0',
'fmt': fmt_pix_imx219,
'embedded': False,
},
],

Expand Down
5 changes: 0 additions & 5 deletions utils/cam-configs/am62a-fpd.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

imx219_w = 640
Expand Down Expand Up @@ -95,7 +93,6 @@ def gen_imx219_pixel(port):
{
'entity': f'{dma_ent} {port}',
'fmt': fmt_pix_imx219,
'embedded': False,
},
],

Expand Down Expand Up @@ -238,8 +235,6 @@ def gen_ub953_tpg(port):
{
'entity': f'{dma_ent} {port}',
'fmt': fmt_tpg,
'embedded': False,
'dra-plane-hack': False,
},
],

Expand Down
4 changes: 0 additions & 4 deletions utils/cam-configs/debix-tpg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

configurations = {}
Expand Down Expand Up @@ -64,8 +62,6 @@
{
'entity': 'rkisp1_mainpath',
'fmt': vfmt,
'embedded': False,
'dra-plane-hack': False,
},
],

Expand Down
4 changes: 0 additions & 4 deletions utils/cam-configs/debix.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

sensor_fmt = (2592, 1940, v4l2.BusFormat.SRGGB12_1X12)
Expand Down Expand Up @@ -59,8 +57,6 @@
{
'entity': 'rkisp1_mainpath',
'fmt': vid_fmt,
'embedded': False,
'dra-plane-hack': False,
},
],

Expand Down
2 changes: 0 additions & 2 deletions utils/cam-configs/desky.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

sensor_1_w = 1280
Expand Down
9 changes: 0 additions & 9 deletions utils/cam-configs/dra76-fpd.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

ov10635_w = 1280
Expand Down Expand Up @@ -111,8 +109,6 @@ def gen_imx390_pixel(port):
{
'entity': f'CAL output {port}',
'fmt': fmt_pix_imx390,
'embedded': False,
'dra-plane-hack': False,
},
],

Expand Down Expand Up @@ -252,8 +248,6 @@ def gen_imx219_pixel(port):
{
'entity': f'CAL output {port}',
'fmt': fmt_pix_imx219,
'embedded': False,
'dra-plane-hack': False,
},
],

Expand Down Expand Up @@ -393,7 +387,6 @@ def gen_ov10635_pixel(port):
{
'entity': f'CAL output {port}',
'fmt': fmt_pix_ov10635,
'embedded': False,
},
],

Expand Down Expand Up @@ -517,8 +510,6 @@ def gen_ub953_tpg(port):
{
'entity': f'CAL output {port}',
'fmt': fmt_tpg,
'embedded': False,
'dra-plane-hack': False,
},
],

Expand Down
2 changes: 0 additions & 2 deletions utils/cam-configs/dra76-ov5640.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

sensor_1_w = 1280
Expand Down
2 changes: 0 additions & 2 deletions utils/cam-configs/j7-ov5640.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

sensor_1_w = 1280
Expand Down
2 changes: 0 additions & 2 deletions utils/cam-configs/lappy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

sensor_1_w = 1280
Expand Down
2 changes: 0 additions & 2 deletions utils/cam-configs/loopback.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

imx219_w = 640
Expand Down
4 changes: 0 additions & 4 deletions utils/cam-configs/rpi4.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

imx219_w = 1920
Expand Down Expand Up @@ -57,8 +55,6 @@
{
'entity': 'unicam-image',
'fmt': fmt_pix_imx219,
'embedded': False,
'dra-plane-hack': False,
},
],

Expand Down
4 changes: 0 additions & 4 deletions utils/cam-configs/rpi5-fpd.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

# Pixel
Expand Down Expand Up @@ -94,7 +92,6 @@ def gen_imx219_pixel(port):
{
'entity': f'rp1-cfe-csi2-ch{port}',
'fmt': fmt_pix_imx219,
'embedded': False,
},
],

Expand Down Expand Up @@ -227,7 +224,6 @@ def gen_ub953_tpg(port):
{
'entity': f'rp1-cfe-csi2-ch{port}',
'fmt': fmt_tpg,
'embedded': False,
},
],

Expand Down
7 changes: 1 addition & 6 deletions utils/cam-configs/rpi5-gmsl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2
import v4l2.uapi

Expand Down Expand Up @@ -33,8 +31,6 @@
mbus_fmt_imx219_meta = (imx219_w, 2, imx219_bus_fmt_meta)
fmt_pix_imx219_meta = (imx219_w, 2, imx219_pix_fmt_meta)

configurations = {}

def gen_imx219_pixel(cameras, port):
sensor_ent = cameras[port][1]
ser_ent = cameras[port][0]
Expand Down Expand Up @@ -99,8 +95,6 @@ def gen_imx219_pixel(cameras, port):
{
'entity': f'rp1-cfe-csi2-ch{port}',
'fmt': fmt_pix,
'embedded': False,
'display': True,
'kms-format': v4l2.PixelFormats.RGB565,
},
],
Expand Down Expand Up @@ -215,6 +209,7 @@ def get_configs():

num_cameras = len(cameras)

configurations = {}
for i in range(num_cameras):
configurations[f'cam{i}'] = gen_imx219_pixel(cameras, i)
configurations[f'cam{i}-meta'] = gen_imx219_meta(cameras, i)
Expand Down
5 changes: 0 additions & 5 deletions utils/cam-configs/rpi5.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

imx219_w = 640
Expand Down Expand Up @@ -63,7 +61,6 @@
{
'entity': 'rp1-cfe-csi2-ch0',
'fmt': fmt_pix_imx219,
'embedded': False,
},
],

Expand Down Expand Up @@ -103,7 +100,6 @@
'entity': 'rp1-cfe-csi2-ch1',
'fmt': meta_fmt_pix_imx219,
'embedded': True,
'display': True,
},
],

Expand Down Expand Up @@ -139,7 +135,6 @@
{
'entity': 'rp1-cfe-csi2-ch0',
'fmt': fmt_pix_imx219,
'embedded': False,
},
],

Expand Down
2 changes: 0 additions & 2 deletions utils/cam-configs/vimc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

imx219_w = 640
Expand Down
2 changes: 0 additions & 2 deletions utils/cam-configs/vivid.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

imx219_w = 640
Expand Down
2 changes: 0 additions & 2 deletions utils/cam-configs/xilinx-tpg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

import v4l2

imx219_w = 640
Expand Down
17 changes: 8 additions & 9 deletions utils/cam.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,18 @@ def parse_args(ctx: Context):
ctx.tx = None
ctx.net_tx = None

if args.type and args.type not in ['drm', 'v4l2']:
if not args.type:
if args.display:
args.type = 'drm'
else:
args.type = 'v4l2'

if args.type not in ['drm', 'v4l2']:
print('Bad buffer type', args.type)
sys.exit(-1)

ctx.use_display = args.display

if args.type:
ctx.buf_type = args.type
else:
if args.display:
ctx.buf_type = 'drm'
else:
ctx.buf_type = 'v4l2'
ctx.buf_type = args.type

ctx.config = read_config(args.config_name, args.params)

Expand Down
4 changes: 2 additions & 2 deletions utils/cam_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def enable_link(source, sink):
if link.is_immutable:
return

link.enabled = True
#src_ent.setup_link(link)

link.enable()
Expand Down Expand Up @@ -87,6 +86,8 @@ def merge_configs(configs):
if 'pads' in subdev:
dst['pads'] += subdev['pads']
if 'routing' in subdev:
if 'routing' not in dst:
dst['routing'] = []
dst['routing'] += subdev['routing']
else:
d['subdevs'].append(subdev)
Expand Down Expand Up @@ -167,7 +168,6 @@ def configure_subdevs(ctx: Context, config):
ent = md.find_entity(e['entity'])
assert ent
subdev = v4l2.SubDevice(ent.interface.dev_path)
assert subdev, f'no subdev for entity {ent}'

if ctx.verbose:
print(f'Configuring {ent.name}')
Expand Down