Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Side by Side Diff: components/exo/wayland/clients/motion_events.cc

Issue 2670283002: exo: Fix render node discovery. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Implementation of a client that produces output in the form of RGBA 5 // Implementation of a client that produces output in the form of RGBA
6 // buffers when receiving pointer/touch events. RGB contains the lower 6 // buffers when receiving pointer/touch events. RGB contains the lower
7 // 24 bits of the event timestamp and A is 0xff. 7 // 24 bits of the event timestamp and A is 0xff.
8 8
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <linux-dmabuf-unstable-v1-client-protocol.h> 10 #include <linux-dmabuf-unstable-v1-client-protocol.h>
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 return 1; 472 return 1;
473 } 473 }
474 474
475 #if defined(OZONE_PLATFORM_GBM) 475 #if defined(OZONE_PLATFORM_GBM)
476 EGLenum egl_sync_type = 0; 476 EGLenum egl_sync_type = 0;
477 sk_sp<const GrGLInterface> native_interface; 477 sk_sp<const GrGLInterface> native_interface;
478 if (use_drm_) { 478 if (use_drm_) {
479 // Number of files to look for when discovering DRM devices. 479 // Number of files to look for when discovering DRM devices.
480 const uint32_t kDrmMaxMinor = 15; 480 const uint32_t kDrmMaxMinor = 15;
481 const uint32_t kRenderNodeStart = 128; 481 const uint32_t kRenderNodeStart = 128;
482 const uint32_t kRenderNodeEnd = kRenderNodeStart + kDrmMaxMinor; 482 const uint32_t kRenderNodeEnd = kRenderNodeStart + kDrmMaxMinor + 1;
483 483
484 for (uint32_t i = kRenderNodeStart; i < kRenderNodeEnd; i++) { 484 for (uint32_t i = kRenderNodeStart; i < kRenderNodeEnd; i++) {
485 std::string dri_render_node( 485 std::string dri_render_node(
486 base::StringPrintf(kDriRenderNodeTemplate, i)); 486 base::StringPrintf(kDriRenderNodeTemplate, i));
487 base::ScopedFD drm_fd(open(dri_render_node.c_str(), O_RDWR)); 487 base::ScopedFD drm_fd(open(dri_render_node.c_str(), O_RDWR));
488 if (drm_fd.get() < 0) 488 if (drm_fd.get() < 0)
489 continue; 489 continue;
490 drmVersionPtr drm_version = drmGetVersion(drm_fd.get()); 490 drmVersionPtr drm_version = drmGetVersion(drm_fd.get());
491 if (!drm_version) { 491 if (!drm_version) {
492 LOG(ERROR) << "Can't get version for device: '" << dri_render_node 492 LOG(ERROR) << "Can't get version for device: '" << dri_render_node
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 new std::string(command_line->GetSwitchValueASCII(switches::kUseDrm))); 994 new std::string(command_line->GetSwitchValueASCII(switches::kUseDrm)));
995 } 995 }
996 996
997 exo::wayland::clients::MotionEvents client( 997 exo::wayland::clients::MotionEvents client(
998 width, height, scale, num_rects, max_frames_pending, 998 width, height, scale, num_rects, max_frames_pending,
999 command_line->HasSwitch(switches::kFullscreen), 999 command_line->HasSwitch(switches::kFullscreen),
1000 command_line->HasSwitch(switches::kShowFpsCounter), num_benchmark_runs, 1000 command_line->HasSwitch(switches::kShowFpsCounter), num_benchmark_runs,
1001 base::TimeDelta::FromMilliseconds(benchmark_interval_ms), use_drm.get()); 1001 base::TimeDelta::FromMilliseconds(benchmark_interval_ms), use_drm.get());
1002 return client.Run(); 1002 return client.Run();
1003 } 1003 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698