← Documents Documentation/userspace-api/media/cec/cec-ioc-adap-g-conn-info.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / CEC

ioctl CEC_ADAP_G_CONNECTOR_INFO

CEC adapter에 대응하는 HDMI connector 유형과 DRM card·connector ID를 설명합니다.

Source pathDocumentation/userspace-api/media/cec/cec-ioc-adap-g-conn-info.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

cec-ioc-adap-g-conn-info.rst:1-106

`CEC_CAP_CONNECTOR_INFO`가 있을 때 CEC device와 HDMI connector의 연결 정보를 조회합니다. 현재 세부 유형은 DRM이며 `card_no`와 `connector_id`로 식별합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2 ..
3 .. Copyright 2019 Google LLC
4 ..
5 .. c:namespace:: CEC
6
7 .. _CEC_ADAP_G_CONNECTOR_INFO:
8
9 *******************************
10 ioctl CEC_ADAP_G_CONNECTOR_INFO
11 *******************************
12
13 Name
14 ====
15
16 CEC_ADAP_G_CONNECTOR_INFO - Query HDMI connector information
17
18 Synopsis
19 ========
20
21 .. c:macro:: CEC_ADAP_G_CONNECTOR_INFO
22
23 ``int ioctl(int fd, CEC_ADAP_G_CONNECTOR_INFO, struct cec_connector_info *argp)``
24
25 Arguments
26 =========
27
28 ``fd``
29 File descriptor returned by :c:func:`open()`.
30
31 ``argp``
32
33 Description
34 ===========
35
36 Using this ioctl an application can learn which HDMI connector this CEC
37 device corresponds to. While calling this ioctl the application should
38 provide a pointer to a cec_connector_info struct which will be populated
39 by the kernel with the info provided by the adapter's driver. This ioctl
40 is only available if the ``CEC_CAP_CONNECTOR_INFO`` capability is set.
41
42 .. tabularcolumns:: |p{1.0cm}|p{4.4cm}|p{2.5cm}|p{9.2cm}|
43
44 .. c:type:: cec_connector_info
45
46 .. flat-table:: struct cec_connector_info
47 :header-rows: 0
48 :stub-columns: 0
49 :widths: 1 1 8
50
51 * - __u32
52 - ``type``
53 - The type of connector this adapter is associated with.
54 * - union {
55 - ``(anonymous)``
56 * - ``struct cec_drm_connector_info``
57 - drm
58 - :ref:`cec-drm-connector-info`
59 * - }
60 -
61
62 .. tabularcolumns:: |p{4.4cm}|p{2.5cm}|p{10.4cm}|
63
64 .. _connector-type:
65
66 .. flat-table:: Connector types
67 :header-rows: 0
68 :stub-columns: 0
69 :widths: 3 1 8
70
71 * .. _`CEC-CONNECTOR-TYPE-NO-CONNECTOR`:
72
73 - ``CEC_CONNECTOR_TYPE_NO_CONNECTOR``
74 - 0
75 - No connector is associated with the adapter/the information is not
76 provided by the driver.
77 * .. _`CEC-CONNECTOR-TYPE-DRM`:
78
79 - ``CEC_CONNECTOR_TYPE_DRM``
80 - 1
81 - Indicates that a DRM connector is associated with this adapter.
82 Information about the connector can be found in
83 :ref:`cec-drm-connector-info`.
84
85 .. tabularcolumns:: |p{4.4cm}|p{2.5cm}|p{10.4cm}|
86
87 .. c:type:: cec_drm_connector_info
88
89 .. _cec-drm-connector-info:
90
91 .. flat-table:: struct cec_drm_connector_info
92 :header-rows: 0
93 :stub-columns: 0
94 :widths: 3 1 8
95
96 * .. _`CEC-DRM-CONNECTOR-TYPE-CARD-NO`:
97
98 - __u32
99 - ``card_no``
100 - DRM card number: the number from a card's path, e.g. 0 in case of
101 /dev/card0.
102 * .. _`CEC-DRM-CONNECTOR-TYPE-CONNECTOR_ID`:
103
104 - __u32
105 - ``connector_id``
106 - DRM connector ID.
107

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

이름, 선언과 인자

1-32

이 문서는 GPL-2.0 라이선스로 제공되며 2019년 Google LLC의 저작권 고지를 포함합니다.

`CEC_ADAP_G_CONNECTOR_INFO`는 CEC adapter와 연결된 HDMI connector 정보를 조회합니다.

함수 형태는 `int ioctl(int fd, CEC_ADAP_G_CONNECTOR_INFO, struct cec_connector_info *argp)`입니다. `fd`는 `open()`이 반환한 descriptor이고 `argp`는 결과를 받을 구조체 pointer입니다.

Connector info 호출
항목설명
requestCEC_ADAP_G_CONNECTOR_INFO
fd열린 CEC device descriptor
argpstruct cec_connector_info *

CEC device가 어느 HDMI connector와 대응하는지 조회합니다.

.. SPDX-License-Identifier: GPL-2.0
..
.. Copyright 2019 Google LLC
..
.. c:namespace:: CEC

.. _CEC_ADAP_G_CONNECTOR_INFO:

*******************************
ioctl CEC_ADAP_G_CONNECTOR_INFO
*******************************

Name
====

CEC_ADAP_G_CONNECTOR_INFO - Query HDMI connector information

Synopsis
========

.. c:macro:: CEC_ADAP_G_CONNECTOR_INFO

``int ioctl(int fd, CEC_ADAP_G_CONNECTOR_INFO, struct cec_connector_info *argp)``

Arguments
=========

``fd``
    File descriptor returned by :c:func:`open()`.

``argp``

조회 조건과 동작

33-41

응용 프로그램은 이 ioctl로 CEC device가 대응하는 HDMI connector를 알 수 있습니다.

응용 프로그램이 `cec_connector_info` pointer를 전달하면 kernel이 adapter driver가 제공한 정보로 구조체를 채웁니다.

이 ioctl은 `CEC_CAP_CONNECTOR_INFO` capability가 설정된 경우에만 사용할 수 있습니다.

Connector 정보 조회
CEC_ADAP_G_CAPSCEC_CAP_CONNECTOR_INFO bit 확인cec_connector_info 준비CEC_ADAP_G_CONNECTOR_INFOkernel이 driver 정보 복사

capability 확인 뒤 driver가 제공한 connector 식별자를 받습니다.

Description
===========

Using this ioctl an application can learn which HDMI connector this CEC
device corresponds to. While calling this ioctl the application should
provide a pointer to a cec_connector_info struct which will be populated
by the kernel with the info provided by the adapter's driver. This ioctl
is only available if the ``CEC_CAP_CONNECTOR_INFO`` capability is set.

struct cec_connector_info

42-61

`type`은 adapter와 연결된 connector 유형을 나타내는 `__u32` 값입니다.

anonymous union은 connector 유형별 세부 정보를 담습니다. 현재 문서화된 member는 `struct cec_drm_connector_info drm`입니다.

cec_connector_info 필드
형식·필드의미
__u32 type연결된 connector 유형
anonymous union유형별 세부 정보
cec_drm_connector_info drmDRM connector 정보

type이 anonymous union의 유효 member를 결정합니다.

.. tabularcolumns:: |p{1.0cm}|p{4.4cm}|p{2.5cm}|p{9.2cm}|

.. c:type:: cec_connector_info

.. flat-table:: struct cec_connector_info
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 1 8

    * - __u32
      - ``type``
      - The type of connector this adapter is associated with.
    * - union {
      - ``(anonymous)``
    * - ``struct cec_drm_connector_info``
      - drm
      - :ref:`cec-drm-connector-info`
    * - }
      -

Connector type

62-84

`CEC_CONNECTOR_TYPE_NO_CONNECTOR` 값은 0입니다. adapter와 연결된 connector가 없거나 driver가 정보를 제공하지 않았음을 뜻합니다.

`CEC_CONNECTOR_TYPE_DRM` 값은 1입니다. 이 adapter와 DRM connector가 연결되어 있고 `cec_drm_connector_info`에서 세부 정보를 찾을 수 있음을 뜻합니다.

Connector type 값
Type의미
CEC_CONNECTOR_TYPE_NO_CONNECTOR0connector 없음 또는 driver 정보 미제공
CEC_CONNECTOR_TYPE_DRM1DRM connector 연결

connector 부재와 DRM 연결을 구분합니다.

.. tabularcolumns:: |p{4.4cm}|p{2.5cm}|p{10.4cm}|

.. _connector-type:

.. flat-table:: Connector types
    :header-rows:  0
    :stub-columns: 0
    :widths:       3 1 8

    * .. _`CEC-CONNECTOR-TYPE-NO-CONNECTOR`:

      - ``CEC_CONNECTOR_TYPE_NO_CONNECTOR``
      - 0
      - No connector is associated with the adapter/the information is not
        provided by the driver.
    * .. _`CEC-CONNECTOR-TYPE-DRM`:

      - ``CEC_CONNECTOR_TYPE_DRM``
      - 1
      - Indicates that a DRM connector is associated with this adapter.
        Information about the connector can be found in
	:ref:`cec-drm-connector-info`.

struct cec_drm_connector_info

85-106

`card_no`는 DRM card 번호입니다. card device path에서 가져오며 `/dev/card0`이면 값은 0입니다.

`connector_id`는 DRM connector ID입니다.

DRM connector 식별자
형식·필드의미
__u32 card_no/dev/cardN 경로의 N
__u32 connector_idDRM connector ID

DRM card와 connector를 함께 식별합니다.

DRM connector 찾기
type == CEC_CONNECTOR_TYPE_DRMdrm.card_no 읽기/dev/cardN 선택drm.connector_id 읽기DRM connector 대응

반환된 두 값을 DRM namespace의 실제 connector에 대응시킵니다.

.. tabularcolumns:: |p{4.4cm}|p{2.5cm}|p{10.4cm}|

.. c:type:: cec_drm_connector_info

.. _cec-drm-connector-info:

.. flat-table:: struct cec_drm_connector_info
    :header-rows:  0
    :stub-columns: 0
    :widths:       3 1 8

    * .. _`CEC-DRM-CONNECTOR-TYPE-CARD-NO`:

      - __u32
      - ``card_no``
      - DRM card number: the number from a card's path, e.g. 0 in case of
        /dev/card0.
    * .. _`CEC-DRM-CONNECTOR-TYPE-CONNECTOR_ID`:

      - __u32
      - ``connector_id``
      - DRM connector ID.