vivid-core.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. /*
  2. * vivid-core.h - core datastructures
  3. *
  4. * Copyright 2014 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  5. *
  6. * This program is free software; you may redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; version 2 of the License.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  11. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  13. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  14. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  15. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  16. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  17. * SOFTWARE.
  18. */
  19. #ifndef _VIVID_CORE_H_
  20. #define _VIVID_CORE_H_
  21. #include <linux/fb.h>
  22. #include <linux/workqueue.h>
  23. #include <media/cec.h>
  24. #include <media/videobuf2-v4l2.h>
  25. #include <media/v4l2-device.h>
  26. #include <media/v4l2-dev.h>
  27. #include <media/v4l2-ctrls.h>
  28. #include <media/v4l2-tpg.h>
  29. #include "vivid-rds-gen.h"
  30. #include "vivid-vbi-gen.h"
  31. #define dprintk(dev, level, fmt, arg...) \
  32. v4l2_dbg(level, vivid_debug, &dev->v4l2_dev, fmt, ## arg)
  33. /* Maximum allowed frame rate
  34. *
  35. * vivid will allow setting timeperframe in [1/FPS_MAX - FPS_MAX/1] range.
  36. *
  37. * Ideally FPS_MAX should be infinity, i.e. practically UINT_MAX, but that
  38. * might hit application errors when they manipulate these values.
  39. *
  40. * Besides, for tpf < 10ms image-generation logic should be changed, to avoid
  41. * producing frames with equal content.
  42. */
  43. #define FPS_MAX 100
  44. /* The maximum number of clip rectangles */
  45. #define MAX_CLIPS 16
  46. /* The maximum number of inputs */
  47. #define MAX_INPUTS 16
  48. /* The maximum number of outputs */
  49. #define MAX_OUTPUTS 16
  50. /* The maximum up or down scaling factor is 4 */
  51. #define MAX_ZOOM 4
  52. /* The maximum image width/height are set to 4K DMT */
  53. #define MAX_WIDTH 4096
  54. #define MAX_HEIGHT 2160
  55. /* The minimum image width/height */
  56. #define MIN_WIDTH 16
  57. #define MIN_HEIGHT 16
  58. /* The data_offset of plane 0 for the multiplanar formats */
  59. #define PLANE0_DATA_OFFSET 128
  60. /* The supported TV frequency range in MHz */
  61. #define MIN_TV_FREQ (44U * 16U)
  62. #define MAX_TV_FREQ (958U * 16U)
  63. /* The number of samples returned in every SDR buffer */
  64. #define SDR_CAP_SAMPLES_PER_BUF 0x4000
  65. /* used by the threads to know when to resync internal counters */
  66. #define JIFFIES_PER_DAY (3600U * 24U * HZ)
  67. #define JIFFIES_RESYNC (JIFFIES_PER_DAY * (0xf0000000U / JIFFIES_PER_DAY))
  68. extern const struct v4l2_rect vivid_min_rect;
  69. extern const struct v4l2_rect vivid_max_rect;
  70. extern unsigned vivid_debug;
  71. struct vivid_fmt {
  72. u32 fourcc; /* v4l2 format id */
  73. enum tgp_color_enc color_enc;
  74. bool can_do_overlay;
  75. u8 vdownsampling[TPG_MAX_PLANES];
  76. u32 alpha_mask;
  77. u8 planes;
  78. u8 buffers;
  79. u32 data_offset[TPG_MAX_PLANES];
  80. u32 bit_depth[TPG_MAX_PLANES];
  81. };
  82. extern struct vivid_fmt vivid_formats[];
  83. /* buffer for one video frame */
  84. struct vivid_buffer {
  85. /* common v4l buffer stuff -- must be first */
  86. struct vb2_v4l2_buffer vb;
  87. struct list_head list;
  88. };
  89. enum vivid_input {
  90. WEBCAM,
  91. TV,
  92. SVID,
  93. HDMI,
  94. };
  95. enum vivid_signal_mode {
  96. CURRENT_DV_TIMINGS,
  97. CURRENT_STD = CURRENT_DV_TIMINGS,
  98. NO_SIGNAL,
  99. NO_LOCK,
  100. OUT_OF_RANGE,
  101. SELECTED_DV_TIMINGS,
  102. SELECTED_STD = SELECTED_DV_TIMINGS,
  103. CYCLE_DV_TIMINGS,
  104. CYCLE_STD = CYCLE_DV_TIMINGS,
  105. CUSTOM_DV_TIMINGS,
  106. };
  107. enum vivid_colorspace {
  108. VIVID_CS_170M,
  109. VIVID_CS_709,
  110. VIVID_CS_SRGB,
  111. VIVID_CS_ADOBERGB,
  112. VIVID_CS_2020,
  113. VIVID_CS_DCI_P3,
  114. VIVID_CS_240M,
  115. VIVID_CS_SYS_M,
  116. VIVID_CS_SYS_BG,
  117. };
  118. #define VIVID_INVALID_SIGNAL(mode) \
  119. ((mode) == NO_SIGNAL || (mode) == NO_LOCK || (mode) == OUT_OF_RANGE)
  120. struct vivid_cec_work {
  121. struct list_head list;
  122. struct delayed_work work;
  123. struct cec_adapter *adap;
  124. struct vivid_dev *dev;
  125. unsigned int usecs;
  126. unsigned int timeout_ms;
  127. u8 tx_status;
  128. struct cec_msg msg;
  129. };
  130. struct vivid_dev {
  131. unsigned inst;
  132. struct v4l2_device v4l2_dev;
  133. struct v4l2_ctrl_handler ctrl_hdl_user_gen;
  134. struct v4l2_ctrl_handler ctrl_hdl_user_vid;
  135. struct v4l2_ctrl_handler ctrl_hdl_user_aud;
  136. struct v4l2_ctrl_handler ctrl_hdl_streaming;
  137. struct v4l2_ctrl_handler ctrl_hdl_sdtv_cap;
  138. struct v4l2_ctrl_handler ctrl_hdl_loop_cap;
  139. struct video_device vid_cap_dev;
  140. struct v4l2_ctrl_handler ctrl_hdl_vid_cap;
  141. struct video_device vid_out_dev;
  142. struct v4l2_ctrl_handler ctrl_hdl_vid_out;
  143. struct video_device vbi_cap_dev;
  144. struct v4l2_ctrl_handler ctrl_hdl_vbi_cap;
  145. struct video_device vbi_out_dev;
  146. struct v4l2_ctrl_handler ctrl_hdl_vbi_out;
  147. struct video_device radio_rx_dev;
  148. struct v4l2_ctrl_handler ctrl_hdl_radio_rx;
  149. struct video_device radio_tx_dev;
  150. struct v4l2_ctrl_handler ctrl_hdl_radio_tx;
  151. struct video_device sdr_cap_dev;
  152. struct v4l2_ctrl_handler ctrl_hdl_sdr_cap;
  153. spinlock_t slock;
  154. struct mutex mutex;
  155. /* capabilities */
  156. u32 vid_cap_caps;
  157. u32 vid_out_caps;
  158. u32 vbi_cap_caps;
  159. u32 vbi_out_caps;
  160. u32 sdr_cap_caps;
  161. u32 radio_rx_caps;
  162. u32 radio_tx_caps;
  163. /* supported features */
  164. bool multiplanar;
  165. unsigned num_inputs;
  166. u8 input_type[MAX_INPUTS];
  167. u8 input_name_counter[MAX_INPUTS];
  168. unsigned num_outputs;
  169. u8 output_type[MAX_OUTPUTS];
  170. u8 output_name_counter[MAX_OUTPUTS];
  171. bool has_audio_inputs;
  172. bool has_audio_outputs;
  173. bool has_vid_cap;
  174. bool has_vid_out;
  175. bool has_vbi_cap;
  176. bool has_raw_vbi_cap;
  177. bool has_sliced_vbi_cap;
  178. bool has_vbi_out;
  179. bool has_raw_vbi_out;
  180. bool has_sliced_vbi_out;
  181. bool has_radio_rx;
  182. bool has_radio_tx;
  183. bool has_sdr_cap;
  184. bool has_fb;
  185. bool can_loop_video;
  186. /* controls */
  187. struct v4l2_ctrl *brightness;
  188. struct v4l2_ctrl *contrast;
  189. struct v4l2_ctrl *saturation;
  190. struct v4l2_ctrl *hue;
  191. struct {
  192. /* autogain/gain cluster */
  193. struct v4l2_ctrl *autogain;
  194. struct v4l2_ctrl *gain;
  195. };
  196. struct v4l2_ctrl *volume;
  197. struct v4l2_ctrl *mute;
  198. struct v4l2_ctrl *alpha;
  199. struct v4l2_ctrl *button;
  200. struct v4l2_ctrl *boolean;
  201. struct v4l2_ctrl *int32;
  202. struct v4l2_ctrl *int64;
  203. struct v4l2_ctrl *menu;
  204. struct v4l2_ctrl *string;
  205. struct v4l2_ctrl *bitmask;
  206. struct v4l2_ctrl *int_menu;
  207. struct v4l2_ctrl *test_pattern;
  208. struct v4l2_ctrl *colorspace;
  209. struct v4l2_ctrl *rgb_range_cap;
  210. struct v4l2_ctrl *real_rgb_range_cap;
  211. struct {
  212. /* std_signal_mode/standard cluster */
  213. struct v4l2_ctrl *ctrl_std_signal_mode;
  214. struct v4l2_ctrl *ctrl_standard;
  215. };
  216. struct {
  217. /* dv_timings_signal_mode/timings cluster */
  218. struct v4l2_ctrl *ctrl_dv_timings_signal_mode;
  219. struct v4l2_ctrl *ctrl_dv_timings;
  220. };
  221. struct v4l2_ctrl *ctrl_has_crop_cap;
  222. struct v4l2_ctrl *ctrl_has_compose_cap;
  223. struct v4l2_ctrl *ctrl_has_scaler_cap;
  224. struct v4l2_ctrl *ctrl_has_crop_out;
  225. struct v4l2_ctrl *ctrl_has_compose_out;
  226. struct v4l2_ctrl *ctrl_has_scaler_out;
  227. struct v4l2_ctrl *ctrl_tx_mode;
  228. struct v4l2_ctrl *ctrl_tx_rgb_range;
  229. struct v4l2_ctrl *radio_tx_rds_pi;
  230. struct v4l2_ctrl *radio_tx_rds_pty;
  231. struct v4l2_ctrl *radio_tx_rds_mono_stereo;
  232. struct v4l2_ctrl *radio_tx_rds_art_head;
  233. struct v4l2_ctrl *radio_tx_rds_compressed;
  234. struct v4l2_ctrl *radio_tx_rds_dyn_pty;
  235. struct v4l2_ctrl *radio_tx_rds_ta;
  236. struct v4l2_ctrl *radio_tx_rds_tp;
  237. struct v4l2_ctrl *radio_tx_rds_ms;
  238. struct v4l2_ctrl *radio_tx_rds_psname;
  239. struct v4l2_ctrl *radio_tx_rds_radiotext;
  240. struct v4l2_ctrl *radio_rx_rds_pty;
  241. struct v4l2_ctrl *radio_rx_rds_ta;
  242. struct v4l2_ctrl *radio_rx_rds_tp;
  243. struct v4l2_ctrl *radio_rx_rds_ms;
  244. struct v4l2_ctrl *radio_rx_rds_psname;
  245. struct v4l2_ctrl *radio_rx_rds_radiotext;
  246. unsigned input_brightness[MAX_INPUTS];
  247. unsigned osd_mode;
  248. unsigned button_pressed;
  249. bool sensor_hflip;
  250. bool sensor_vflip;
  251. bool hflip;
  252. bool vflip;
  253. bool vbi_cap_interlaced;
  254. bool loop_video;
  255. bool reduced_fps;
  256. /* Framebuffer */
  257. unsigned long video_pbase;
  258. void *video_vbase;
  259. u32 video_buffer_size;
  260. int display_width;
  261. int display_height;
  262. int display_byte_stride;
  263. int bits_per_pixel;
  264. int bytes_per_pixel;
  265. struct fb_info fb_info;
  266. struct fb_var_screeninfo fb_defined;
  267. struct fb_fix_screeninfo fb_fix;
  268. /* Error injection */
  269. bool queue_setup_error;
  270. bool buf_prepare_error;
  271. bool start_streaming_error;
  272. bool dqbuf_error;
  273. bool seq_wrap;
  274. bool time_wrap;
  275. u64 time_wrap_offset;
  276. unsigned perc_dropped_buffers;
  277. enum vivid_signal_mode std_signal_mode;
  278. unsigned query_std_last;
  279. v4l2_std_id query_std;
  280. enum tpg_video_aspect std_aspect_ratio;
  281. enum vivid_signal_mode dv_timings_signal_mode;
  282. char **query_dv_timings_qmenu;
  283. unsigned query_dv_timings_size;
  284. unsigned query_dv_timings_last;
  285. unsigned query_dv_timings;
  286. enum tpg_video_aspect dv_timings_aspect_ratio;
  287. /* Input */
  288. unsigned input;
  289. v4l2_std_id std_cap;
  290. struct v4l2_dv_timings dv_timings_cap;
  291. u32 service_set_cap;
  292. struct vivid_vbi_gen_data vbi_gen;
  293. u8 *edid;
  294. unsigned edid_blocks;
  295. unsigned edid_max_blocks;
  296. unsigned webcam_size_idx;
  297. unsigned webcam_ival_idx;
  298. unsigned tv_freq;
  299. unsigned tv_audmode;
  300. unsigned tv_field_cap;
  301. unsigned tv_audio_input;
  302. /* Capture Overlay */
  303. struct v4l2_framebuffer fb_cap;
  304. struct v4l2_fh *overlay_cap_owner;
  305. void *fb_vbase_cap;
  306. int overlay_cap_top, overlay_cap_left;
  307. enum v4l2_field overlay_cap_field;
  308. void *bitmap_cap;
  309. struct v4l2_clip clips_cap[MAX_CLIPS];
  310. struct v4l2_clip try_clips_cap[MAX_CLIPS];
  311. unsigned clipcount_cap;
  312. /* Output */
  313. unsigned output;
  314. v4l2_std_id std_out;
  315. struct v4l2_dv_timings dv_timings_out;
  316. u32 colorspace_out;
  317. u32 ycbcr_enc_out;
  318. u32 hsv_enc_out;
  319. u32 quantization_out;
  320. u32 xfer_func_out;
  321. u32 service_set_out;
  322. unsigned bytesperline_out[TPG_MAX_PLANES];
  323. unsigned tv_field_out;
  324. unsigned tv_audio_output;
  325. bool vbi_out_have_wss;
  326. u8 vbi_out_wss[2];
  327. bool vbi_out_have_cc[2];
  328. u8 vbi_out_cc[2][2];
  329. bool dvi_d_out;
  330. u8 *scaled_line;
  331. u8 *blended_line;
  332. unsigned cur_scaled_line;
  333. /* Output Overlay */
  334. void *fb_vbase_out;
  335. bool overlay_out_enabled;
  336. int overlay_out_top, overlay_out_left;
  337. void *bitmap_out;
  338. struct v4l2_clip clips_out[MAX_CLIPS];
  339. struct v4l2_clip try_clips_out[MAX_CLIPS];
  340. unsigned clipcount_out;
  341. unsigned fbuf_out_flags;
  342. u32 chromakey_out;
  343. u8 global_alpha_out;
  344. /* video capture */
  345. struct tpg_data tpg;
  346. unsigned ms_vid_cap;
  347. bool must_blank[VIDEO_MAX_FRAME];
  348. const struct vivid_fmt *fmt_cap;
  349. struct v4l2_fract timeperframe_vid_cap;
  350. enum v4l2_field field_cap;
  351. struct v4l2_rect src_rect;
  352. struct v4l2_rect fmt_cap_rect;
  353. struct v4l2_rect crop_cap;
  354. struct v4l2_rect compose_cap;
  355. struct v4l2_rect crop_bounds_cap;
  356. struct vb2_queue vb_vid_cap_q;
  357. struct list_head vid_cap_active;
  358. struct vb2_queue vb_vbi_cap_q;
  359. struct list_head vbi_cap_active;
  360. /* thread for generating video capture stream */
  361. struct task_struct *kthread_vid_cap;
  362. unsigned long jiffies_vid_cap;
  363. u32 cap_seq_offset;
  364. u32 cap_seq_count;
  365. bool cap_seq_resync;
  366. u32 vid_cap_seq_start;
  367. u32 vid_cap_seq_count;
  368. bool vid_cap_streaming;
  369. u32 vbi_cap_seq_start;
  370. u32 vbi_cap_seq_count;
  371. bool vbi_cap_streaming;
  372. bool stream_sliced_vbi_cap;
  373. /* video output */
  374. const struct vivid_fmt *fmt_out;
  375. struct v4l2_fract timeperframe_vid_out;
  376. enum v4l2_field field_out;
  377. struct v4l2_rect sink_rect;
  378. struct v4l2_rect fmt_out_rect;
  379. struct v4l2_rect crop_out;
  380. struct v4l2_rect compose_out;
  381. struct v4l2_rect compose_bounds_out;
  382. struct vb2_queue vb_vid_out_q;
  383. struct list_head vid_out_active;
  384. struct vb2_queue vb_vbi_out_q;
  385. struct list_head vbi_out_active;
  386. /* video loop precalculated rectangles */
  387. /*
  388. * Intersection between what the output side composes and the capture side
  389. * crops. I.e., what actually needs to be copied from the output buffer to
  390. * the capture buffer.
  391. */
  392. struct v4l2_rect loop_vid_copy;
  393. /* The part of the output buffer that (after scaling) corresponds to loop_vid_copy. */
  394. struct v4l2_rect loop_vid_out;
  395. /* The part of the capture buffer that (after scaling) corresponds to loop_vid_copy. */
  396. struct v4l2_rect loop_vid_cap;
  397. /*
  398. * The intersection of the framebuffer, the overlay output window and
  399. * loop_vid_copy. I.e., the part of the framebuffer that actually should be
  400. * blended with the compose_out rectangle. This uses the framebuffer origin.
  401. */
  402. struct v4l2_rect loop_fb_copy;
  403. /* The same as loop_fb_copy but with compose_out origin. */
  404. struct v4l2_rect loop_vid_overlay;
  405. /*
  406. * The part of the capture buffer that (after scaling) corresponds
  407. * to loop_vid_overlay.
  408. */
  409. struct v4l2_rect loop_vid_overlay_cap;
  410. /* thread for generating video output stream */
  411. struct task_struct *kthread_vid_out;
  412. unsigned long jiffies_vid_out;
  413. u32 out_seq_offset;
  414. u32 out_seq_count;
  415. bool out_seq_resync;
  416. u32 vid_out_seq_start;
  417. u32 vid_out_seq_count;
  418. bool vid_out_streaming;
  419. u32 vbi_out_seq_start;
  420. u32 vbi_out_seq_count;
  421. bool vbi_out_streaming;
  422. bool stream_sliced_vbi_out;
  423. /* SDR capture */
  424. struct vb2_queue vb_sdr_cap_q;
  425. struct list_head sdr_cap_active;
  426. u32 sdr_pixelformat; /* v4l2 format id */
  427. unsigned sdr_buffersize;
  428. unsigned sdr_adc_freq;
  429. unsigned sdr_fm_freq;
  430. unsigned sdr_fm_deviation;
  431. int sdr_fixp_src_phase;
  432. int sdr_fixp_mod_phase;
  433. bool tstamp_src_is_soe;
  434. bool has_crop_cap;
  435. bool has_compose_cap;
  436. bool has_scaler_cap;
  437. bool has_crop_out;
  438. bool has_compose_out;
  439. bool has_scaler_out;
  440. /* thread for generating SDR stream */
  441. struct task_struct *kthread_sdr_cap;
  442. unsigned long jiffies_sdr_cap;
  443. u32 sdr_cap_seq_offset;
  444. u32 sdr_cap_seq_count;
  445. bool sdr_cap_seq_resync;
  446. /* RDS generator */
  447. struct vivid_rds_gen rds_gen;
  448. /* Radio receiver */
  449. unsigned radio_rx_freq;
  450. unsigned radio_rx_audmode;
  451. int radio_rx_sig_qual;
  452. unsigned radio_rx_hw_seek_mode;
  453. bool radio_rx_hw_seek_prog_lim;
  454. bool radio_rx_rds_controls;
  455. bool radio_rx_rds_enabled;
  456. unsigned radio_rx_rds_use_alternates;
  457. unsigned radio_rx_rds_last_block;
  458. struct v4l2_fh *radio_rx_rds_owner;
  459. /* Radio transmitter */
  460. unsigned radio_tx_freq;
  461. unsigned radio_tx_subchans;
  462. bool radio_tx_rds_controls;
  463. unsigned radio_tx_rds_last_block;
  464. struct v4l2_fh *radio_tx_rds_owner;
  465. /* Shared between radio receiver and transmitter */
  466. bool radio_rds_loop;
  467. struct timespec radio_rds_init_ts;
  468. /* CEC */
  469. struct cec_adapter *cec_rx_adap;
  470. struct cec_adapter *cec_tx_adap[MAX_OUTPUTS];
  471. struct workqueue_struct *cec_workqueue;
  472. spinlock_t cec_slock;
  473. struct list_head cec_work_list;
  474. unsigned int cec_xfer_time_jiffies;
  475. unsigned long cec_xfer_start_jiffies;
  476. u8 cec_output2bus_map[MAX_OUTPUTS];
  477. /* CEC OSD String */
  478. char osd[14];
  479. unsigned long osd_jiffies;
  480. };
  481. static inline bool vivid_is_webcam(const struct vivid_dev *dev)
  482. {
  483. return dev->input_type[dev->input] == WEBCAM;
  484. }
  485. static inline bool vivid_is_tv_cap(const struct vivid_dev *dev)
  486. {
  487. return dev->input_type[dev->input] == TV;
  488. }
  489. static inline bool vivid_is_svid_cap(const struct vivid_dev *dev)
  490. {
  491. return dev->input_type[dev->input] == SVID;
  492. }
  493. static inline bool vivid_is_hdmi_cap(const struct vivid_dev *dev)
  494. {
  495. return dev->input_type[dev->input] == HDMI;
  496. }
  497. static inline bool vivid_is_sdtv_cap(const struct vivid_dev *dev)
  498. {
  499. return vivid_is_tv_cap(dev) || vivid_is_svid_cap(dev);
  500. }
  501. static inline bool vivid_is_svid_out(const struct vivid_dev *dev)
  502. {
  503. return dev->output_type[dev->output] == SVID;
  504. }
  505. static inline bool vivid_is_hdmi_out(const struct vivid_dev *dev)
  506. {
  507. return dev->output_type[dev->output] == HDMI;
  508. }
  509. #endif