@@ -934,6 +934,7 @@ struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper)
934934 }
935935
936936 fb_helper -> fbdev = info ;
937+ info -> skip_vt_switch = true;
937938
938939 return info ;
939940
@@ -2036,21 +2037,8 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
20362037 return 0 ;
20372038}
20382039
2039- /**
2040- * drm_fb_helper_fill_fix - initializes fixed fbdev information
2041- * @info: fbdev registered by the helper
2042- * @pitch: desired pitch
2043- * @depth: desired depth
2044- *
2045- * Helper to fill in the fixed fbdev information useful for a non-accelerated
2046- * fbdev emulations. Drivers which support acceleration methods which impose
2047- * additional constraints need to set up their own limits.
2048- *
2049- * Drivers should call this (or their equivalent setup code) from their
2050- * &drm_fb_helper_funcs.fb_probe callback.
2051- */
2052- void drm_fb_helper_fill_fix (struct fb_info * info , uint32_t pitch ,
2053- uint32_t depth )
2040+ static void drm_fb_helper_fill_fix (struct fb_info * info , uint32_t pitch ,
2041+ uint32_t depth )
20542042{
20552043 info -> fix .type = FB_TYPE_PACKED_PIXELS ;
20562044 info -> fix .visual = depth == 8 ? FB_VISUAL_PSEUDOCOLOR :
@@ -2065,24 +2053,10 @@ void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
20652053
20662054 info -> fix .line_length = pitch ;
20672055}
2068- EXPORT_SYMBOL (drm_fb_helper_fill_fix );
20692056
2070- /**
2071- * drm_fb_helper_fill_var - initalizes variable fbdev information
2072- * @info: fbdev instance to set up
2073- * @fb_helper: fb helper instance to use as template
2074- * @fb_width: desired fb width
2075- * @fb_height: desired fb height
2076- *
2077- * Sets up the variable fbdev metainformation from the given fb helper instance
2078- * and the drm framebuffer allocated in &drm_fb_helper.fb.
2079- *
2080- * Drivers should call this (or their equivalent setup code) from their
2081- * &drm_fb_helper_funcs.fb_probe callback after having allocated the fbdev
2082- * backing storage framebuffer.
2083- */
2084- void drm_fb_helper_fill_var (struct fb_info * info , struct drm_fb_helper * fb_helper ,
2085- uint32_t fb_width , uint32_t fb_height )
2057+ static void drm_fb_helper_fill_var (struct fb_info * info ,
2058+ struct drm_fb_helper * fb_helper ,
2059+ uint32_t fb_width , uint32_t fb_height )
20862060{
20872061 struct drm_framebuffer * fb = fb_helper -> fb ;
20882062
@@ -2102,7 +2076,36 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe
21022076 info -> var .xres = fb_width ;
21032077 info -> var .yres = fb_height ;
21042078}
2105- EXPORT_SYMBOL (drm_fb_helper_fill_var );
2079+
2080+ /**
2081+ * drm_fb_helper_fill_info - initializes fbdev information
2082+ * @info: fbdev instance to set up
2083+ * @fb_helper: fb helper instance to use as template
2084+ * @sizes: describes fbdev size and scanout surface size
2085+ *
2086+ * Sets up the variable and fixed fbdev metainformation from the given fb helper
2087+ * instance and the drm framebuffer allocated in &drm_fb_helper.fb.
2088+ *
2089+ * Drivers should call this (or their equivalent setup code) from their
2090+ * &drm_fb_helper_funcs.fb_probe callback after having allocated the fbdev
2091+ * backing storage framebuffer.
2092+ */
2093+ void drm_fb_helper_fill_info (struct fb_info * info ,
2094+ struct drm_fb_helper * fb_helper ,
2095+ struct drm_fb_helper_surface_size * sizes )
2096+ {
2097+ struct drm_framebuffer * fb = fb_helper -> fb ;
2098+
2099+ drm_fb_helper_fill_fix (info , fb -> pitches [0 ], fb -> format -> depth );
2100+ drm_fb_helper_fill_var (info , fb_helper ,
2101+ sizes -> fb_width , sizes -> fb_height );
2102+
2103+ info -> par = fb_helper ;
2104+ snprintf (info -> fix .id , sizeof (info -> fix .id ), "%sdrmfb" ,
2105+ fb_helper -> dev -> driver -> name );
2106+
2107+ }
2108+ EXPORT_SYMBOL (drm_fb_helper_fill_info );
21062109
21072110static int drm_fb_helper_probe_connector_modes (struct drm_fb_helper * fb_helper ,
21082111 uint32_t maxX ,
@@ -2780,9 +2783,8 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper,
27802783 *
27812784 * This function will call down into the &drm_fb_helper_funcs.fb_probe callback
27822785 * to let the driver allocate and initialize the fbdev info structure and the
2783- * drm framebuffer used to back the fbdev. drm_fb_helper_fill_var() and
2784- * drm_fb_helper_fill_fix() are provided as helpers to setup simple default
2785- * values for the fbdev info structure.
2786+ * drm framebuffer used to back the fbdev. drm_fb_helper_fill_info() is provided
2787+ * as a helper to setup simple default values for the fbdev info structure.
27862788 *
27872789 * HANG DEBUGGING:
27882790 *
@@ -3151,7 +3153,6 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,
31513153 if (IS_ERR (fbi ))
31523154 return PTR_ERR (fbi );
31533155
3154- fbi -> par = fb_helper ;
31553156 fbi -> fbops = & drm_fbdev_fb_ops ;
31563157 fbi -> screen_size = fb -> height * fb -> pitches [0 ];
31573158 fbi -> fix .smem_len = fbi -> screen_size ;
@@ -3162,10 +3163,7 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,
31623163 fbi -> fix .smem_start =
31633164 page_to_phys (virt_to_page (fbi -> screen_buffer ));
31643165#endif
3165- strcpy (fbi -> fix .id , "DRM emulated" );
3166-
3167- drm_fb_helper_fill_fix (fbi , fb -> pitches [0 ], fb -> format -> depth );
3168- drm_fb_helper_fill_var (fbi , fb_helper , sizes -> fb_width , sizes -> fb_height );
3166+ drm_fb_helper_fill_info (fbi , fb_helper , sizes );
31693167
31703168 if (fb -> funcs -> dirty ) {
31713169 struct fb_ops * fbops ;
0 commit comments