Comments (3)
Life with component ordering is always complicated.
tc358743 is an upstream driver with relatively minimal changes. It was written by Cisco for some of their video conferencing kit. IIRC it was against an ST SoC, but it may have been TI.
They've defined that the media bus code is MEDIA_BUS_FMT_RGB888_1X24
Checking the definition for MEDIA_BUS_FMT_RGB888_1X24, it is putting B in the LSBs of the bus. CSI-2 does send the data LSB and blue first, so would make sense as a mapping,
As a cause for further confusion, the CSI-2 spec (I'm looking at v1.01.00 r0.04 2-Apr-2009) does include 12.2 RGB888 Data Reception
The RGB888 data format byte to 32-bit memory word mapping follows the generic CSI-2 rule.
Figure 110 that follows writes B0 into the LSB of a 32bit word.
Section 12.7 YUV422 8-bit Data Reception and figure 115 that follows says that format does NOT follow the generic CSI-2 rule, and whilst U1 is sent first on the wire, it is written into the MSB of a 32bit word.
However the whole of section 12 is marked as informative.
I can't see anything in the Unicam docs that imply it does implement the generic CSI-2 rule. I don't see why it would ever be implemented on a big endian system such as ARM, as it means that the byte order is totally messed if wanting to access individual components as bytes (memory order would be B2 R1 G1 B1 G3 B3 R2 G2
!)
Looking at how MEDIA_BUS_FMT_RGB888_1X24 should map to a V4L2_PIX_FMT_xx define, comparing against V4L2_PIX_FMT_SRGGB16 and MEDIA_BUS_FMT_SRGGB16_1X16, I can see an argument that MEDIA_BUS_FMT_RGB888_1X24 should be V4L2_PIX_FMT_BGR24.
TC358743 is the only vaguely supported device on the Pi using the format (we don't support OV5640, ADV7511, ADV7605, or ADV7842), so swapping them would be of limited risk, but needs a chunk more studying. I don't see an equivalent in any other driver which would have given me more confidence in the change.
from linux.
And it wasn't unnoticed - there are various forum threads where GStreamer's capssetter is being used to swap bgr to rgb when using tc358743.
from linux.
Thanks for researching this. It looks like total hell. I believe CISCO can use byte swapping in its userspace (or a format overriding, whatever), and it looks like this is the path I should follow right now to avoid headache.
from linux.
Related Issues (20)
- CM4S: Enabling xhci from an overlay makes the system hang HOT 11
- stable_* tags missing for 6.6.y kernels HOT 7
- Cannot disable EEE on Raspberry Pi 5 HOT 10
- ADS7846 Touch controller does not work correctly after upgrade to kernel 6.6.20 HOT 4
- PCF2131 RTC support + low battery detection HOT 1
- Can't set CPU affinity on RP1 downstream interrupts HOT 3
- Bookworm lite with official 7" display display garbled with rotate 180deg
- USB Touchscreen kills xHCI Controller HOT 5
- cfg80211: loaded regulatory.db is malformed or signature is missing/invalid HOT 2
- No way to set Full Range RGB HOT 2
- Bookworm lite with official 7" display display regression HOT 21
- writing to /sys/class/gpio/export results in write error: Invalid argument HOT 6
- offical 7" touchscreen does not rotate on the Raspberry Pi 5 HOT 9
- bluetooth.service issue with SAP on bullseye HOT 1
- config.txt core_freq=499 causes camera error
- i2c controller timed out with 2024-03-15 bookworm-64bit HOT 2
- Bluetooth - getting really tired of this... HOT 2
- Kernel 6.6.16 freeze with rpi2 rev B when using usb device HOT 3
- Kernel 6.6 have memory leak on nfs HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linux.