File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,17 +174,20 @@ fn try_open_card(path: &Path) -> Result<DrmBackend> {
174174
175175impl DrmBackend {
176176 pub fn open_card ( ) -> Result < DrmBackend > {
177+ let mut errors = Vec :: new ( ) ;
177178 for entry in fs:: read_dir ( "/dev/dri/" ) ? {
178179 let entry = entry?;
179180 if !entry. file_name ( ) . to_string_lossy ( ) . starts_with ( "card" ) {
180181 continue
181182 }
182183 match try_open_card ( & entry. path ( ) ) {
183184 Ok ( card) => return Ok ( card) ,
184- Err ( _) => { }
185+ Err ( err) => {
186+ errors. push ( format ! ( "{}: {}" , entry. path( ) . as_os_str( ) . to_string_lossy( ) , err. to_string( ) ) )
187+ }
185188 }
186189 }
187- Err ( anyhow ! ( "No touchbar device found" ) )
190+ Err ( anyhow ! ( "No touchbar device found, attempted: [ \n {} \n ]" , errors . join ( ", \n " ) ) )
188191 }
189192 pub fn dirty ( & self , clips : & [ ClipRect ] ) -> Result < ( ) > {
190193 Ok ( self . card . dirty_framebuffer ( self . fb , clips) ?)
You can’t perform that action at this time.
0 commit comments