diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index 6aaf8db0..4ae293b4 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -302,7 +302,8 @@ apkbuild_custom_valid_options = [ "!pmb:kconfigcheck", "pmb:cross-native", "pmb:cross-native2", - "pmb:gpu-accel", + "pmb:drm", + "pmb:gpu-accel", # deprecated "pmb:strict", "pmb:systemd", "pmb:systemd-never", diff --git a/pmb/config/init.py b/pmb/config/init.py index 22196732..f1d0afd0 100644 --- a/pmb/config/init.py +++ b/pmb/config/init.py @@ -229,12 +229,13 @@ def ask_for_channel(config: Config) -> str: def ask_for_ui(deviceinfo: Deviceinfo) -> str: ui_list = pmb.helpers.ui.list_ui(deviceinfo.arch) hidden_ui_count = 0 - device_is_accelerated = deviceinfo.gpu_accelerated == "true" - if not device_is_accelerated: + if not deviceinfo.drm == "true": for i in reversed(range(len(ui_list))): pkgname = f"postmarketos-ui-{ui_list[i][0]}" apkbuild = pmb.helpers.pmaports.get(pkgname, subpackages=False, must_exist=False) - if apkbuild and "pmb:gpu-accel" in apkbuild["options"]: + if apkbuild and ( + "pmb:drm" in apkbuild["options"] or "pmb:gpu-accel" in apkbuild["options"] + ): ui_list.pop(i) hidden_ui_count += 1 @@ -251,7 +252,7 @@ def ask_for_ui(deviceinfo: Deviceinfo) -> str: if hidden_ui_count > 0: logging.info( f"NOTE: {hidden_ui_count} UIs are hidden because" - ' "deviceinfo_gpu_accelerated" is not set (see' + ' "deviceinfo_drm" is not set (see' " https://postmarketos.org/deviceinfo)." ) while True: diff --git a/pmb/helpers/lint.py b/pmb/helpers/lint.py index e339859c..cdbc4eb5 100644 --- a/pmb/helpers/lint.py +++ b/pmb/helpers/lint.py @@ -23,7 +23,7 @@ import pmb.helpers.pmaports def get_custom_valid_options() -> list[str]: """Build a list of custom valid APKBUILD options that apkbuild-lint should not complain about. The list consists of hardcoded options from - pmb.config.apkbuild_custom_valid_options like pmb:gpu-accel, as well as + pmb.config.apkbuild_custom_valid_options like pmb:drm, as well as dynamically generated options from kconfigcheck.toml (pmb:kconfigcheck-libcamera etc.).""" ret = list(pmb.config.apkbuild_custom_valid_options) diff --git a/pmb/parse/deviceinfo.py b/pmb/parse/deviceinfo.py index 75496fb9..fcfeb045 100644 --- a/pmb/parse/deviceinfo.py +++ b/pmb/parse/deviceinfo.py @@ -110,7 +110,7 @@ class Deviceinfo: chassis: str keyboard: str | None = "" # deprecated external_storage: str | None = "" - gpu_accelerated: bool | None = False + drm: bool | None = False dev_touchscreen: str | None = "" dev_touchscreen_calibration: str | None = "" append_dtb: str | None = "" @@ -279,6 +279,8 @@ class Deviceinfo: # logging.warning(f"deviceinfo: {key} is not a known attribute") if key == "arch": setattr(self, key, Arch.from_str(value)) + elif key == "gpu_accelerated": # deprecated + setattr(self, "drm", value) else: setattr(self, key, value)