Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162373245
D58090.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D58090.diff
View Options
diff --git a/sys/dev/firewire/fwcam.h b/sys/dev/firewire/fwcam.h
--- a/sys/dev/firewire/fwcam.h
+++ b/sys/dev/firewire/fwcam.h
@@ -225,6 +225,8 @@
uint32_t basic_func; /* BASIC_FUNC_INQ */
uint32_t features_hi; /* FEATURE_HI_INQ */
uint32_t features_lo; /* FEATURE_LO_INQ */
+ uint32_t modes[8]; /* V_MODE_INQ per format */
+ uint32_t rates[8][8]; /* V_RATE_INQ per format/mode */
/* Current settings */
uint8_t cur_format;
diff --git a/sys/dev/firewire/fwcam.c b/sys/dev/firewire/fwcam.c
--- a/sys/dev/firewire/fwcam.c
+++ b/sys/dev/firewire/fwcam.c
@@ -173,7 +173,7 @@
static int
fwcam_read_capabilities(struct fwcam_softc *sc)
{
- int err;
+ int err, f, m;
err = fwcam_read_quadlet(sc, IIDC_V_FORMAT_INQ, &sc->formats);
if (err) {
@@ -189,6 +189,30 @@
return (err);
}
+ /* Read mode and rate inquiry registers for each supported format */
+ for (f = 0; f < 8; f++) {
+ if (!(sc->formats & (1 << (31 - f)))) {
+ sc->modes[f] = 0;
+ continue;
+ }
+ err = fwcam_read_quadlet(sc, IIDC_V_MODE_INQ(f),
+ &sc->modes[f]);
+ if (err) {
+ sc->modes[f] = 0;
+ continue;
+ }
+ for (m = 0; m < 8; m++) {
+ if (!(sc->modes[f] & (1 << (31 - m)))) {
+ sc->rates[f][m] = 0;
+ continue;
+ }
+ err = fwcam_read_quadlet(sc, IIDC_V_RATE_INQ(f, m),
+ &sc->rates[f][m]);
+ if (err)
+ sc->rates[f][m] = 0;
+ }
+ }
+
err = fwcam_read_quadlet(sc, IIDC_FEATURE_HI_INQ, &sc->features_hi);
if (err)
sc->features_hi = 0;
@@ -815,10 +839,13 @@
if (mode->format > 7 || mode->mode > 7 || mode->framerate > 7)
return (EINVAL);
- if (mode->format != IIDC_FMT_VGA)
- return (EINVAL);
if (!(sc->formats & (1 << (31 - mode->format))))
return (EINVAL);
+ if (!(sc->modes[mode->format] & (1 << (31 - mode->mode))))
+ return (EINVAL);
+ if (!(sc->rates[mode->format][mode->mode] &
+ (1 << (31 - mode->framerate))))
+ return (EINVAL);
FWCAM_LOCK(sc);
if (sc->state == FWCAM_STATE_DETACHING) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jul 13, 2:53 PM (9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34854389
Default Alt Text
D58090.diff (1 KB)
Attached To
Mode
D58090: fwcam: add dynamic resolution and frame rate support
Attached
Detach File
Event Timeline
Log In to Comment