Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'media/v4.20-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:

- add a missing include at v4l2-controls uAPI header

- minor kAPI update for the request API

- some fixes at CEC core

- use a lower minimum height for the virtual codec driver

- cleanup a gcc warning due to the lack of a fall though markup

- tc358743: Remove unnecessary self assignment

- fix the V4L event subscription logic

- docs: Document metadata format in struct v4l2_format

- omap3isp and ipu3-cio2: fix unbinding logic

* tag 'media/v4.20-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
media: ipu3-cio2: Use cio2_queues_exit
media: ipu3-cio2: Unregister device nodes first, then release resources
media: omap3isp: Unregister media device as first
media: docs: Document metadata format in struct v4l2_format
media: v4l: event: Add subscription to list before calling "add" operation
media: dm365_ipipeif: better annotate a fall though
media: Rename vb2_m2m_request_queue -> v4l2_m2m_request_queue
media: cec: increase debug level for 'queue full'
media: cec: check for non-OK/NACK conditions while claiming a LA
media: vicodec: lower minimum height to 360
media: tc358743: Remove unnecessary self assignment
media: v4l: fix uapi mpeg slice params definition
v4l2-controls: add a missing include

+91 -45
+1 -1
Documentation/media/uapi/v4l/dev-meta.rst
··· 40 40 the desired operation. Both drivers and applications must set the remainder of 41 41 the :c:type:`v4l2_format` structure to 0. 42 42 43 - .. _v4l2-meta-format: 43 + .. c:type:: v4l2_meta_format 44 44 45 45 .. tabularcolumns:: |p{1.4cm}|p{2.2cm}|p{13.9cm}| 46 46
+5
Documentation/media/uapi/v4l/vidioc-g-fmt.rst
··· 133 133 - Definition of a data format, see :ref:`pixfmt`, used by SDR 134 134 capture and output devices. 135 135 * - 136 + - struct :c:type:`v4l2_meta_format` 137 + - ``meta`` 138 + - Definition of a metadata format, see :ref:`meta-formats`, used by 139 + metadata capture devices. 140 + * - 136 141 - __u8 137 142 - ``raw_data``\ [200] 138 143 - Place holder for future extensions.
+38 -11
drivers/media/cec/cec-adap.c
··· 807 807 } 808 808 809 809 if (adap->transmit_queue_sz >= CEC_MAX_MSG_TX_QUEUE_SZ) { 810 - dprintk(1, "%s: transmit queue full\n", __func__); 810 + dprintk(2, "%s: transmit queue full\n", __func__); 811 811 return -EBUSY; 812 812 } 813 813 ··· 1180 1180 { 1181 1181 struct cec_log_addrs *las = &adap->log_addrs; 1182 1182 struct cec_msg msg = { }; 1183 + const unsigned int max_retries = 2; 1184 + unsigned int i; 1183 1185 int err; 1184 1186 1185 1187 if (cec_has_log_addr(adap, log_addr)) ··· 1190 1188 /* Send poll message */ 1191 1189 msg.len = 1; 1192 1190 msg.msg[0] = (log_addr << 4) | log_addr; 1193 - err = cec_transmit_msg_fh(adap, &msg, NULL, true); 1191 + 1192 + for (i = 0; i < max_retries; i++) { 1193 + err = cec_transmit_msg_fh(adap, &msg, NULL, true); 1194 + 1195 + /* 1196 + * While trying to poll the physical address was reset 1197 + * and the adapter was unconfigured, so bail out. 1198 + */ 1199 + if (!adap->is_configuring) 1200 + return -EINTR; 1201 + 1202 + if (err) 1203 + return err; 1204 + 1205 + /* 1206 + * The message was aborted due to a disconnect or 1207 + * unconfigure, just bail out. 1208 + */ 1209 + if (msg.tx_status & CEC_TX_STATUS_ABORTED) 1210 + return -EINTR; 1211 + if (msg.tx_status & CEC_TX_STATUS_OK) 1212 + return 0; 1213 + if (msg.tx_status & CEC_TX_STATUS_NACK) 1214 + break; 1215 + /* 1216 + * Retry up to max_retries times if the message was neither 1217 + * OKed or NACKed. This can happen due to e.g. a Lost 1218 + * Arbitration condition. 1219 + */ 1220 + } 1194 1221 1195 1222 /* 1196 - * While trying to poll the physical address was reset 1197 - * and the adapter was unconfigured, so bail out. 1223 + * If we are unable to get an OK or a NACK after max_retries attempts 1224 + * (and note that each attempt already consists of four polls), then 1225 + * then we assume that something is really weird and that it is not a 1226 + * good idea to try and claim this logical address. 1198 1227 */ 1199 - if (!adap->is_configuring) 1200 - return -EINTR; 1201 - 1202 - if (err) 1203 - return err; 1204 - 1205 - if (msg.tx_status & CEC_TX_STATUS_OK) 1228 + if (i == max_retries) 1206 1229 return 0; 1207 1230 1208 1231 /*
-1
drivers/media/i2c/tc358743.c
··· 1918 1918 ret = v4l2_fwnode_endpoint_alloc_parse(of_fwnode_handle(ep), &endpoint); 1919 1919 if (ret) { 1920 1920 dev_err(dev, "failed to parse endpoint\n"); 1921 - ret = ret; 1922 1921 goto put_node; 1923 1922 } 1924 1923
+4 -6
drivers/media/pci/intel/ipu3/ipu3-cio2.c
··· 1844 1844 static void cio2_pci_remove(struct pci_dev *pci_dev) 1845 1845 { 1846 1846 struct cio2_device *cio2 = pci_get_drvdata(pci_dev); 1847 - unsigned int i; 1848 1847 1849 - cio2_notifier_exit(cio2); 1850 - cio2_fbpt_exit_dummy(cio2); 1851 - for (i = 0; i < CIO2_QUEUES; i++) 1852 - cio2_queue_exit(cio2, &cio2->queue[i]); 1853 - v4l2_device_unregister(&cio2->v4l2_dev); 1854 1848 media_device_unregister(&cio2->media_dev); 1849 + cio2_notifier_exit(cio2); 1850 + cio2_queues_exit(cio2); 1851 + cio2_fbpt_exit_dummy(cio2); 1852 + v4l2_device_unregister(&cio2->v4l2_dev); 1855 1853 media_device_cleanup(&cio2->media_dev); 1856 1854 mutex_destroy(&cio2->lock); 1857 1855 }
+2 -1
drivers/media/platform/omap3isp/isp.c
··· 1587 1587 1588 1588 static void isp_unregister_entities(struct isp_device *isp) 1589 1589 { 1590 + media_device_unregister(&isp->media_dev); 1591 + 1590 1592 omap3isp_csi2_unregister_entities(&isp->isp_csi2a); 1591 1593 omap3isp_ccp2_unregister_entities(&isp->isp_ccp2); 1592 1594 omap3isp_ccdc_unregister_entities(&isp->isp_ccdc); ··· 1599 1597 omap3isp_stat_unregister_entities(&isp->isp_hist); 1600 1598 1601 1599 v4l2_device_unregister(&isp->v4l2_dev); 1602 - media_device_unregister(&isp->media_dev); 1603 1600 media_device_cleanup(&isp->media_dev); 1604 1601 } 1605 1602
+1 -1
drivers/media/platform/vicodec/vicodec-core.c
··· 42 42 #define MAX_WIDTH 4096U 43 43 #define MIN_WIDTH 640U 44 44 #define MAX_HEIGHT 2160U 45 - #define MIN_HEIGHT 480U 45 + #define MIN_HEIGHT 360U 46 46 47 47 #define dprintk(dev, fmt, arg...) \ 48 48 v4l2_dbg(1, debug, &dev->v4l2_dev, "%s: " fmt, __func__, ## arg)
+1 -1
drivers/media/platform/vim2m.c
··· 1009 1009 1010 1010 static const struct media_device_ops m2m_media_ops = { 1011 1011 .req_validate = vb2_request_validate, 1012 - .req_queue = vb2_m2m_request_queue, 1012 + .req_queue = v4l2_m2m_request_queue, 1013 1013 }; 1014 1014 1015 1015 static int vim2m_probe(struct platform_device *pdev)
+5
drivers/media/v4l2-core/v4l2-ctrls.c
··· 1664 1664 p_mpeg2_slice_params->forward_ref_index >= VIDEO_MAX_FRAME) 1665 1665 return -EINVAL; 1666 1666 1667 + if (p_mpeg2_slice_params->pad || 1668 + p_mpeg2_slice_params->picture.pad || 1669 + p_mpeg2_slice_params->sequence.pad) 1670 + return -EINVAL; 1671 + 1667 1672 return 0; 1668 1673 1669 1674 case V4L2_CTRL_TYPE_MPEG2_QUANTIZATION:
+24 -19
drivers/media/v4l2-core/v4l2-event.c
··· 193 193 } 194 194 EXPORT_SYMBOL_GPL(v4l2_event_pending); 195 195 196 + static void __v4l2_event_unsubscribe(struct v4l2_subscribed_event *sev) 197 + { 198 + struct v4l2_fh *fh = sev->fh; 199 + unsigned int i; 200 + 201 + lockdep_assert_held(&fh->subscribe_lock); 202 + assert_spin_locked(&fh->vdev->fh_lock); 203 + 204 + /* Remove any pending events for this subscription */ 205 + for (i = 0; i < sev->in_use; i++) { 206 + list_del(&sev->events[sev_pos(sev, i)].list); 207 + fh->navailable--; 208 + } 209 + list_del(&sev->list); 210 + } 211 + 196 212 int v4l2_event_subscribe(struct v4l2_fh *fh, 197 213 const struct v4l2_event_subscription *sub, unsigned elems, 198 214 const struct v4l2_subscribed_event_ops *ops) ··· 240 224 241 225 spin_lock_irqsave(&fh->vdev->fh_lock, flags); 242 226 found_ev = v4l2_event_subscribed(fh, sub->type, sub->id); 227 + if (!found_ev) 228 + list_add(&sev->list, &fh->subscribed); 243 229 spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); 244 230 245 231 if (found_ev) { 246 232 /* Already listening */ 247 233 kvfree(sev); 248 - goto out_unlock; 249 - } 250 - 251 - if (sev->ops && sev->ops->add) { 234 + } else if (sev->ops && sev->ops->add) { 252 235 ret = sev->ops->add(sev, elems); 253 236 if (ret) { 237 + spin_lock_irqsave(&fh->vdev->fh_lock, flags); 238 + __v4l2_event_unsubscribe(sev); 239 + spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); 254 240 kvfree(sev); 255 - goto out_unlock; 256 241 } 257 242 } 258 243 259 - spin_lock_irqsave(&fh->vdev->fh_lock, flags); 260 - list_add(&sev->list, &fh->subscribed); 261 - spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); 262 - 263 - out_unlock: 264 244 mutex_unlock(&fh->subscribe_lock); 265 245 266 246 return ret; ··· 291 279 { 292 280 struct v4l2_subscribed_event *sev; 293 281 unsigned long flags; 294 - int i; 295 282 296 283 if (sub->type == V4L2_EVENT_ALL) { 297 284 v4l2_event_unsubscribe_all(fh); ··· 302 291 spin_lock_irqsave(&fh->vdev->fh_lock, flags); 303 292 304 293 sev = v4l2_event_subscribed(fh, sub->type, sub->id); 305 - if (sev != NULL) { 306 - /* Remove any pending events for this subscription */ 307 - for (i = 0; i < sev->in_use; i++) { 308 - list_del(&sev->events[sev_pos(sev, i)].list); 309 - fh->navailable--; 310 - } 311 - list_del(&sev->list); 312 - } 294 + if (sev != NULL) 295 + __v4l2_event_unsubscribe(sev); 313 296 314 297 spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); 315 298
+2 -2
drivers/media/v4l2-core/v4l2-mem2mem.c
··· 953 953 } 954 954 EXPORT_SYMBOL_GPL(v4l2_m2m_buf_queue); 955 955 956 - void vb2_m2m_request_queue(struct media_request *req) 956 + void v4l2_m2m_request_queue(struct media_request *req) 957 957 { 958 958 struct media_request_object *obj, *obj_safe; 959 959 struct v4l2_m2m_ctx *m2m_ctx = NULL; ··· 997 997 if (m2m_ctx) 998 998 v4l2_m2m_try_schedule(m2m_ctx); 999 999 } 1000 - EXPORT_SYMBOL_GPL(vb2_m2m_request_queue); 1000 + EXPORT_SYMBOL_GPL(v4l2_m2m_request_queue); 1001 1001 1002 1002 /* Videobuf2 ioctl helpers */ 1003 1003
+1
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c
··· 310 310 ipipeif_write(val, ipipeif_base_addr, IPIPEIF_CFG2); 311 311 break; 312 312 } 313 + /* fall through */ 313 314 314 315 case IPIPEIF_SDRAM_YUV: 315 316 /* Set clock divider */
+1 -1
drivers/staging/media/sunxi/cedrus/cedrus.c
··· 253 253 254 254 static const struct media_device_ops cedrus_m2m_media_ops = { 255 255 .req_validate = cedrus_request_validate, 256 - .req_queue = vb2_m2m_request_queue, 256 + .req_queue = v4l2_m2m_request_queue, 257 257 }; 258 258 259 259 static int cedrus_probe(struct platform_device *pdev)
+1 -1
include/media/v4l2-mem2mem.h
··· 624 624 625 625 /* v4l2 request helper */ 626 626 627 - void vb2_m2m_request_queue(struct media_request *req); 627 + void v4l2_m2m_request_queue(struct media_request *req); 628 628 629 629 /* v4l2 ioctl helpers */ 630 630
+5
include/uapi/linux/v4l2-controls.h
··· 50 50 #ifndef __LINUX_V4L2_CONTROLS_H 51 51 #define __LINUX_V4L2_CONTROLS_H 52 52 53 + #include <linux/types.h> 54 + 53 55 /* Control classes */ 54 56 #define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ 55 57 #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ ··· 1112 1110 __u8 profile_and_level_indication; 1113 1111 __u8 progressive_sequence; 1114 1112 __u8 chroma_format; 1113 + __u8 pad; 1115 1114 }; 1116 1115 1117 1116 struct v4l2_mpeg2_picture { ··· 1131 1128 __u8 alternate_scan; 1132 1129 __u8 repeat_first_field; 1133 1130 __u8 progressive_frame; 1131 + __u8 pad; 1134 1132 }; 1135 1133 1136 1134 struct v4l2_ctrl_mpeg2_slice_params { ··· 1146 1142 1147 1143 __u8 backward_ref_index; 1148 1144 __u8 forward_ref_index; 1145 + __u8 pad; 1149 1146 }; 1150 1147 1151 1148 struct v4l2_ctrl_mpeg2_quantization {