Skip to content

Commit

Permalink
drm: remove selecting the card number with --drm-connector
Browse files Browse the repository at this point in the history
f560437 deprecated this since the
--drm-device path option was added as a replacement. Drop the card
number selection logic.
  • Loading branch information
Dudemanguy committed Sep 21, 2023
1 parent b96da9c commit 1e9bb45
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
2 changes: 2 additions & 0 deletions DOCS/interface-changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ Interface changes
`--demuxer-force-retry-on-eof`, `--fit-border` options
- remove deprecated `--record-file` option
- remove deprecated `--vf-defaults` and `--af-defaults` options
- `--drm-connector` no longer allows selecting the card number (use `--drm-device`
instead)
--- mpv 0.36.0 ---
- add `--target-contrast`
- Target luminance value is now also applied when ICC profile is used.
Expand Down
9 changes: 3 additions & 6 deletions DOCS/man/vo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -602,18 +602,15 @@ Available video output drivers are:

The following global options are supported by this video output:

``--drm-connector=[<gpu_number>.]<name>``
``--drm-connector=<name>``
Select the connector to use (usually this is a monitor.) If ``<name>``
is empty or ``auto``, mpv renders the output on the first available
connector. Use ``--drm-connector=help`` to get a list of available
connectors. The ``<gpu_number>`` argument can be used to disambiguate
multiple graphic cards, but is deprecated in favor of ``--drm-device``.
(default: empty)
connectors. (default: empty)

``--drm-device=<path>``
Select the DRM device file to use. If specified this overrides automatic
card selection and any card number specified ``--drm-connector``.
(default: empty)
card selection. (default: empty)

``--drm-mode=<preferred|highest|N|WxH[@R]>``
Mode to use (resolution and frame rate).
Expand Down
19 changes: 1 addition & 18 deletions video/out/drm_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,22 +906,6 @@ static void get_primary_device_path(struct vo_drm_state *drm)
drmFreeDevices(devices, card_count);
}


static char *parse_connector_spec(struct vo_drm_state *drm)
{
if (!drm->opts->connector_spec)
return NULL;
char *dot_ptr = strchr(drm->opts->connector_spec, '.');
if (dot_ptr) {
MP_WARN(drm, "Warning: Selecting a connector by index with drm-connector "
"is deprecated. Use the drm-device option instead.\n");
drm->card_no = strtoul(drm->opts->connector_spec, NULL, 10);
return talloc_strdup(drm, dot_ptr + 1);
} else {
return talloc_strdup(drm, drm->opts->connector_spec);
}
}

static void drm_pflip_cb(int fd, unsigned int msc, unsigned int sec,
unsigned int usec, void *data)
{
Expand Down Expand Up @@ -1031,7 +1015,6 @@ bool vo_drm_init(struct vo *vo)
drm->opts = mp_get_config_group(drm, drm->vo->global, &drm_conf);

drmModeRes *res = NULL;
char *connector_name = parse_connector_spec(drm);
get_primary_device_path(drm);

if (!drm->card_path) {
Expand All @@ -1058,7 +1041,7 @@ bool vo_drm_init(struct vo *vo)
goto err;
}

if (!setup_connector(drm, res, connector_name))
if (!setup_connector(drm, res, drm->opts->connector_spec))
goto err;
if (!setup_crtc(drm, res))
goto err;
Expand Down

0 comments on commit 1e9bb45

Please sign in to comment.