@ -60,19 +60,20 @@
/**
/**
* struct drm_printer - drm output " stream "
* struct drm_printer - drm output " stream "
* @ printfn : actual output fxn
* @ arg : output fxn specific data
*
*
* Do not use struct members directly . Use drm_printer_seq_file ( ) ,
* Do not use struct members directly . Use drm_printer_seq_file ( ) ,
* drm_printer_info ( ) , etc to initialize . And drm_printf ( ) for output .
* drm_printer_info ( ) , etc to initialize . And drm_printf ( ) for output .
*/
*/
struct drm_printer {
struct drm_printer {
/* private: */
void ( * printfn ) ( struct drm_printer * p , struct va_format * vaf ) ;
void ( * printfn ) ( struct drm_printer * p , struct va_format * vaf ) ;
void * arg ;
void * arg ;
const char * prefix ;
} ;
} ;
void __drm_printfn_seq_file ( struct drm_printer * p , struct va_format * vaf ) ;
void __drm_printfn_seq_file ( struct drm_printer * p , struct va_format * vaf ) ;
void __drm_printfn_info ( struct drm_printer * p , struct va_format * vaf ) ;
void __drm_printfn_info ( struct drm_printer * p , struct va_format * vaf ) ;
void __drm_printfn_debug ( struct drm_printer * p , struct va_format * vaf ) ;
void drm_printf ( struct drm_printer * p , const char * f , . . . ) ;
void drm_printf ( struct drm_printer * p , const char * f , . . . ) ;
@ -109,4 +110,19 @@ static inline struct drm_printer drm_info_printer(struct device *dev)
return p ;
return p ;
}
}
/**
* drm_debug_printer - construct a & drm_printer that outputs to pr_debug ( )
* @ prefix : debug output prefix
*
* RETURNS :
* The & drm_printer object
*/
static inline struct drm_printer drm_debug_printer ( const char * prefix )
{
struct drm_printer p = {
. printfn = __drm_printfn_debug ,
. prefix = prefix
} ;
return p ;
}
# endif /* DRM_PRINT_H_ */
# endif /* DRM_PRINT_H_ */