D27980: make opengl module support multiple dri devices

Aleix Pol Gonzalez noreply at phabricator.kde.org
Wed Mar 11 14:44:27 GMT 2020


apol added subscribers: adridg, apol.
apol added a comment.


  +1 overall

INLINE COMMENTS

> opengl.cpp:278
> +
> +static QList<DriInfo> get_dri_devices_proc()
>  {

I'd make it QVector, less to worry in the future.

> opengl.cpp:281
> +    QList<DriInfo> list;
> +    const auto entries = QDir(QStringLiteral("/proc/dri/")).entryList();
> +    for (const auto &entry : entries) {

Probably only want to list files?

> opengl.cpp:303
> +        int num = 0;
> +        if (((num = ReadPipe(cmd, pci_info)) ||
> +             (num = ReadPipe("/sbin/"+cmd, pci_info)) ||

Use QStandardPaths::findExecutable?

> opengl.cpp:334
> +    QList<DriInfo> list;
>  	QStringList pci_info;
> +    if (ReadPipe("sysctl -n hw.dri.0.name", pci_info)) {

Indentation looks off

> opengl.cpp:335
>  	QStringList pci_info;
> -	if (ReadPipe("sysctl -n hw.dri.0.name",pci_info)) {
> -		dri_info.module = pci_info[0].mid(0, pci_info[0].indexOf(0x20));
> -		}
> -	return false;
> +    if (ReadPipe("sysctl -n hw.dri.0.name", pci_info)) {
> +        DriInfo info{};

Probably want to list them all on BSD too, right @adridg?

REPOSITORY
  R102 KInfoCenter

REVISION DETAIL
  https://phabricator.kde.org/D27980

To: sitter
Cc: apol, adridg, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200311/a3216c7a/attachment-0001.html>


More information about the Plasma-devel mailing list