~mir-team/mir/development-branch

« back to all changes in this revision

Viewing changes to src/platforms/mesa/server/platform.cpp

merge trunk and resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include "mir/options/option.h"
27
27
#include "mir/graphics/native_buffer.h"
28
28
#include "mir/emergency_cleanup_registry.h"
 
29
#include "mir/udev/wrapper.h"
29
30
 
30
31
 
31
32
#include <boost/throw_exception.hpp>
185
186
        report, vt, *emergency_cleanup_registry, bypass_option);
186
187
}
187
188
 
188
 
//TODO: internal client support was dropped. should remove this call from the mesa egl impl
189
 
//and remove this function
190
 
extern "C" int mir_server_mesa_egl_native_display_is_valid(MirMesaEGLNativeDisplay*)
191
 
{
192
 
    return false;
193
 
}
194
 
 
195
 
extern "C" void add_platform_options(boost::program_options::options_description& config)
 
189
extern "C" void add_graphics_platform_options(boost::program_options::options_description& config)
196
190
{
197
191
    config.add_options()
198
192
        (vt_option_name,
202
196
         boost::program_options::value<bool>()->default_value(true),
203
197
         "[platform-specific] utilize the bypass optimization for fullscreen surfaces.");
204
198
}
 
199
 
 
200
extern "C" mg::PlatformPriority probe_graphics_platform()
 
201
{
 
202
    auto udev = std::make_shared<mir::udev::Context>();
 
203
 
 
204
    mir::udev::Enumerator drm_devices{udev};
 
205
    drm_devices.match_subsystem("drm");
 
206
    drm_devices.match_sysname("card[0-9]*");
 
207
    drm_devices.scan_devices();
 
208
 
 
209
    for (auto& device : drm_devices)
 
210
    {
 
211
        static_cast<void>(device);
 
212
        return mg::PlatformPriority::best;
 
213
    }
 
214
 
 
215
    return mg::PlatformPriority::unsupported;
 
216
}
 
217
 
 
218
mir::ModuleProperties const description = {
 
219
    "mesa",
 
220
    MIR_VERSION_MAJOR,
 
221
    MIR_VERSION_MINOR,
 
222
    MIR_VERSION_MICRO
 
223
};
 
224
 
 
225
extern "C" mir::ModuleProperties const* describe_graphics_module()
 
226
{
 
227
    return &description;
 
228
}