drm: remove selecting the card number with --drm-connector

f560437594 deprecated this since the
--drm-device path option was added as a replacement. Drop the card
number selection logic.
This commit is contained in:
Dudemanguy 2023-09-20 00:26:25 -05:00
parent 177fe48d79
commit be89e07229
3 changed files with 6 additions and 24 deletions

View File

@ -85,6 +85,8 @@ Interface changes
`--demuxer-force-retry-on-eof`, `--fit-border` options `--demuxer-force-retry-on-eof`, `--fit-border` options
- remove deprecated `--record-file` option - remove deprecated `--record-file` option
- remove deprecated `--vf-defaults` and `--af-defaults` options - 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 --- --- mpv 0.36.0 ---
- add `--target-contrast` - add `--target-contrast`
- Target luminance value is now also applied when ICC profile is used. - Target luminance value is now also applied when ICC profile is used.

View File

@ -602,18 +602,15 @@ Available video output drivers are:
The following global options are supported by this video output: 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>`` Select the connector to use (usually this is a monitor.) If ``<name>``
is empty or ``auto``, mpv renders the output on the first available is empty or ``auto``, mpv renders the output on the first available
connector. Use ``--drm-connector=help`` to get a list of available connector. Use ``--drm-connector=help`` to get a list of available
connectors. The ``<gpu_number>`` argument can be used to disambiguate connectors. (default: empty)
multiple graphic cards, but is deprecated in favor of ``--drm-device``.
(default: empty)
``--drm-device=<path>`` ``--drm-device=<path>``
Select the DRM device file to use. If specified this overrides automatic Select the DRM device file to use. If specified this overrides automatic
card selection and any card number specified ``--drm-connector``. card selection. (default: empty)
(default: empty)
``--drm-mode=<preferred|highest|N|WxH[@R]>`` ``--drm-mode=<preferred|highest|N|WxH[@R]>``
Mode to use (resolution and frame rate). Mode to use (resolution and frame rate).

View File

@ -906,22 +906,6 @@ err:
drmFreeDevices(devices, card_count); 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, static void drm_pflip_cb(int fd, unsigned int msc, unsigned int sec,
unsigned int usec, void *data) unsigned int usec, void *data)
{ {
@ -1031,7 +1015,6 @@ bool vo_drm_init(struct vo *vo)
drm->opts = mp_get_config_group(drm, drm->vo->global, &drm_conf); drm->opts = mp_get_config_group(drm, drm->vo->global, &drm_conf);
drmModeRes *res = NULL; drmModeRes *res = NULL;
char *connector_name = parse_connector_spec(drm);
get_primary_device_path(drm); get_primary_device_path(drm);
if (!drm->card_path) { if (!drm->card_path) {
@ -1058,7 +1041,7 @@ bool vo_drm_init(struct vo *vo)
goto err; goto err;
} }
if (!setup_connector(drm, res, connector_name)) if (!setup_connector(drm, res, drm->opts->connector_spec))
goto err; goto err;
if (!setup_crtc(drm, res)) if (!setup_crtc(drm, res))
goto err; goto err;