요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. 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``
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.
.. 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`
* - }
-
.. 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`.
.. 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.
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입니다.
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가 설정된 경우에만 사용할 수 있습니다.
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`입니다.
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 부재와 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 card와 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.
요약·해설
cec-ioc-adap-g-conn-info.rst:1-106`CEC_CAP_CONNECTOR_INFO`가 있을 때 CEC device와 HDMI connector의 연결 정보를 조회합니다. 현재 세부 유형은 DRM이며 `card_no`와 `connector_id`로 식별합니다.