fb_backend: use new udev function to detect framebuffer devices, if one is not set
Reviewers: #kwin, graesslin Reviewed By: #kwin, graesslin Subscribers: rkflx, graesslin, anthonyfieroni, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D9556
This commit is contained in:
parent
3c745bb571
commit
8321453fde
1 changed files with 11 additions and 5 deletions
|
@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "scene_qpainter_fb_backend.h"
|
||||
#include "screens.h"
|
||||
#include "virtual_terminal.h"
|
||||
#include "udev.h"
|
||||
// system
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
@ -81,13 +82,18 @@ void FramebufferBackend::init()
|
|||
void FramebufferBackend::openFrameBuffer()
|
||||
{
|
||||
VirtualTerminal::self()->init();
|
||||
int fd = LogindIntegration::self()->takeDevice(deviceIdentifier().constData());
|
||||
if (fd < 0) {
|
||||
qCWarning(KWIN_FB) << "Failed to open frame buffer device through logind, trying without";
|
||||
QString framebufferDevice = deviceIdentifier().constData();
|
||||
if (framebufferDevice.isEmpty()) {
|
||||
framebufferDevice = QString(Udev().primaryFramebuffer()->devNode());
|
||||
}
|
||||
fd = open(deviceIdentifier().constData(), O_RDWR | O_CLOEXEC);
|
||||
int fd = LogindIntegration::self()->takeDevice(framebufferDevice.toUtf8().constData());
|
||||
qCDebug(KWIN_FB) << "Using frame buffer device:" << framebufferDevice;
|
||||
if (fd < 0) {
|
||||
qCWarning(KWIN_FB) << "failed to open frame buffer device";
|
||||
qCWarning(KWIN_FB) << "Failed to open frame buffer device:" << framebufferDevice << "through logind, trying without";
|
||||
}
|
||||
fd = open(framebufferDevice.toUtf8().constData(), O_RDWR | O_CLOEXEC);
|
||||
if (fd < 0) {
|
||||
qCWarning(KWIN_FB) << "failed to open frame buffer device:" << framebufferDevice;
|
||||
emit initFailed();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue