drm: export cmdline and preferred mode functions from fb helper
Subsystems (3)
PATCH 1/6 drm: export cmdline and preferred mode functions from fb helper
This allows drivers to use them in custom initial_config functions.
--- drivers/gpu/drm/drm_fb_helper.c | 6 ++++-- include/drm/drm_fb_helper.h | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +4 -2
@@ -1136,7 +1136,7 @@ static int drm_fb_helper_probe_connector_modes(struct drm_fb_helper *fb_helper,return count; } -static struct drm_display_mode *drm_has_preferred_mode (struct drm_fb_helper_connector *fb_connector,int width,int height) +struct drm_display_mode *drm_has_preferred_mode (struct drm_fb_helper_connector *fb_connector,int width,int height) {struct drm_display_mode *mode;
@@ -1149,6 +1149,7 @@ static struct drm_display_mode *drm_has_preferred_mode(struct drm_fb_helper_conn }return NULL ; } +EXPORT_SYMBOL (drm_has_preferred_mode);static bool drm_has_cmdline_mode (struct drm_fb_helper_connector *fb_connector) {
@@ -1157,7 +1158,7 @@ static bool drm_has_cmdline_mode(struct drm_fb_helper_connector *fb_connector)return cmdline_mode->specified; } -static struct drm_display_mode *drm_pick_cmdline_mode (struct drm_fb_helper_connector *fb_helper_conn, +struct drm_display_mode *drm_pick_cmdline_mode (struct drm_fb_helper_connector *fb_helper_conn,int width,int height) {struct drm_cmdline_mode *cmdline_mode;
@@ -1197,6 +1198,7 @@ create_mode:list_add (&mode->head, &fb_helper_conn->connector->modes);return mode; } +EXPORT_SYMBOL (drm_pick_cmdline_mode);static bool drm_connector_enabled (struct drm_connector *connector,bool strict) {
include/drm/drm_fb_helper.h +6 -0
@@ -121,5 +121,11 @@ bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel);int drm_fb_helper_single_add_all_connectors (struct drm_fb_helper *fb_helper);int drm_fb_helper_debug_enter (struct fb_info *info);int drm_fb_helper_debug_leave (struct fb_info *info); +struct drm_display_mode * +drm_has_preferred_mode (struct drm_fb_helper_connector *fb_connector, +int width,int height); +struct drm_display_mode * +drm_pick_cmdline_mode (struct drm_fb_helper_connector *fb_helper_conn, +int width,int height);#endif
Signature · 1 line
1.7.9.5
PATCH 2/6 drm/i915: allow re-use BIOS connector config for initial fbdev config v3
The BIOS or boot loader will generally create an initial display configuration for us that includes some set of active pipes and displays. This routine tries to figure out which pipes and connectors are active and stuffs them into the crtcs and modes array given to us by the drm_fb_helper code.
The overall sequence is:
intel_fbdev_init - from driver load
intel_fbdev_init_bios - initialize the intel_fbdev using BIOS data drm_fb_helper_init - build fb helper structs drm_fb_helper_single_add_all_connectors - more fb helper structs
intel_fbdev_initial_config - apply the config
drm_fb_helper_initial_config - call ->probe then register_framebuffer()
drm_setup_crtcs - build crtc config for fbdev
intel_fb_initial_config - find active connectors etc
drm_fb_helper_single_fb_probe - set up fbdev
intelfb_create - re-use or alloc fb, build out fbdev structs
v2: use BIOS connector config unconditionally if possible (Daniel)
check for crtc cloning and reject (Daniel)
fix up comments (Daniel)
v3: use command line args and preferred modes first (Ville)
--- drivers/gpu/drm/i915/intel_display.c | 10 ++- drivers/gpu/drm/i915/intel_fbdev.c | 123 ++++++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_display.c +4 -6
@@ -51,7 +51,10 @@ static void ironlake_pch_clock_get(struct intel_crtc *crtc,static int intel_set_mode (struct drm_crtc *crtc,struct drm_display_mode *mode,int x,int y,struct drm_framebuffer *old_fb); - +static int intel_framebuffer_init (struct drm_device *dev, +struct intel_framebuffer *ifb, +struct drm_mode_fb_cmd2 *mode_cmd, +struct drm_i915_gem_object *obj); typedef struct { int min, max;
@@ -7692,11 +7695,6 @@ static struct drm_display_mode load_detect_mode = { 704, 832, 0, 480, 489, 491, 520, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC), }; -static int intel_framebuffer_init (struct drm_device *dev, -struct intel_framebuffer *ifb, -struct drm_mode_fb_cmd2 *mode_cmd, -struct drm_i915_gem_object *obj); -struct drm_framebuffer * __intel_framebuffer_create(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,
drivers/gpu/drm/i915/intel_fbdev.c +123 -0
130 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 3/6 drm/i915: add plane_config fetching infrastructure
In reply to Jesse BarnesEarly at init time, we can try to read out the plane config structure and try to preserve it if possible.
--- drivers/gpu/drm/i915/i915_drv.h | 3 ++ drivers/gpu/drm/i915/intel_display.c | 82 ++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_drv.h | 8 ++++ 3 files changed, 93 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +3 -0
@@ -397,6 +397,7 @@ struct drm_i915_error_state {struct intel_connector ;struct intel_crtc_config ; +struct intel_plane_config ;struct intel_crtc ;struct intel_limit ;struct dpll ;
@@ -435,6 +436,8 @@ struct drm_i915_display_funcs {* fills out the pipe-config with the hw state. */ bool (*get_pipe_config)(struct intel_crtc *,struct intel_crtc_config *); +void (*get_plane_config)(struct intel_crtc *, +struct intel_plane_config *);int (*crtc_mode_set)(struct drm_crtc *crtc,int x,int y,struct drm_framebuffer *old_fb);
drivers/gpu/drm/i915/intel_display.c +82 -0
100 lines not on this page · raw message
drivers/gpu/drm/i915/intel_drv.h +8 -0
@@ -210,6 +210,12 @@ typedef struct dpll {int p; } intel_clock_t; +struct intel_plane_config { +struct intel_framebuffer *fb;/* ends up managed by intel_fbdev.c */ +bool tiled; +int size; +}; +struct intel_crtc_config {/** * quirks - bitfield with hw state readout quirks
@@ -358,6 +364,7 @@ struct intel_crtc {int16_t cursor_width, cursor_height;bool cursor_visible; +struct intel_plane_config plane_config;struct intel_crtc_config config;struct intel_crtc_config *new_config;bool new_enabled;
@@ -728,6 +735,7 @@ void intel_display_set_init_power(struct drm_device *dev, bool enable);int valleyview_get_vco (struct drm_i915_private *dev_priv);void intel_mode_from_pipe_config (struct drm_display_mode *mode,struct intel_crtc_config *pipe_config); +int intel_format_to_fourcc (int format);/* intel_dp.c */ void intel_dp_init (struct drm_device *dev,int output_reg,enum port port);
Signature · 1 line
1.7.9.5
PATCH 4/6 drm/i915: get_plane_config for i9xx v12
In reply to Jesse BarnesRead out the current plane configuration at init time into a new plane_config structure. This allows us to track any existing framebuffers attached to the plane and potentially re-use them in our fbdev code for a smooth handoff.
v2: update for new pitch_for_width function (Jesse)
comment how get_plane_config works with shared fbs (Jesse)
v3: s/ARGB/XRGB (Ville)
use pipesrc width/height (Ville)
fix fourcc comment (Bob)
use drm_format_plane_cpp (Ville)
v4: use fb for tracking fb data object (Ville)
v5: fix up gen2 pitch limits (Ville)
v6: read out stride as well (Daniel)
v7: split out init ordering changes (Daniel)
don't fetch config if !CONFIG_FB
v8: use proper height in get_plane_config (Chris)
v9: fix CONFIG_FB check for modular configs (Jani)
v10: add comment about stolen allocation stomping
v11: drop hw state readout hunk (Daniel)
v12: handle tiled BIOS fbs (Kristian)
pull out common bits (Jesse)
--- drivers/gpu/drm/i915/intel_display.c | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)
drivers/gpu/drm/i915/intel_display.c +67 -0
@@ -5577,6 +5577,71 @@ static void vlv_crtc_clock_get(struct intel_crtc *crtc, pipe_config->port_clock = clock.dot /5 ; } +static void i9xx_get_plane_config (struct intel_crtc *crtc, +struct intel_plane_config *plane_config) +{ +struct drm_device *dev = crtc->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +u32 val, base, offset; +int pipe = crtc->pipe, plane = crtc->plane; +int fourcc, pixel_format; +int aligned_height; + + plane_config->fb =kzalloc (sizeof (*plane_config->fb),GFP_KERNEL ); +if (!plane_config->fb) { +DRM_DEBUG_KMS ("failed to alloc fb\n" ); +return ; + } + + val =I915_READ (DSPCNTR (plane)); + +if (INTEL_INFO (dev)->gen >=4 ) +if (val &DISPPLANE_TILED ) + plane_config->tiled = true; + + pixel_format = val &DISPPLANE_PIXFORMAT_MASK ; + fourcc =intel_format_to_fourcc (pixel_format); + plane_config->fb->base.pixel_format = fourcc; + plane_config->fb->base.bits_per_pixel = +drm_format_plane_cpp (fourcc,0 ) *8 ; + +if (INTEL_INFO (dev)->gen >=4 ) { +if (plane_config->tiled) + offset =I915_READ (DSPTILEOFF (plane)); +else + offset =I915_READ (DSPLINOFF (plane)); + base =I915_READ (DSPSURF (plane)) &0xfffff000 ; + }else { + base =I915_READ (DSPADDR (plane)); + } + + val =I915_READ (PIPESRC (pipe)); + plane_config->fb->base.width = ((val >>16 ) &0xfff ) +1 ; + plane_config->fb->base.height = ((val >>0 ) &0xfff ) +1 ; + + val =I915_READ (DSPSTRIDE (pipe)); + plane_config->fb->base.pitches[0 ] = val &0xffffff80 ; + + aligned_height =intel_align_height (dev, plane_config->fb->base.height, + plane_config->tiled); + + plane_config->size =ALIGN (plane_config->fb->base.pitches[0 ] * + aligned_height,PAGE_SIZE ); + +DRM_DEBUG_KMS ("pipe/plane %d/%d with fb: size=%dx%d@%d, offset=%x, pitch %d, size 0x%x\n" , + pipe, plane, plane_config->fb->base.width, + plane_config->fb->base.height, + plane_config->fb->base.bits_per_pixel, base, + plane_config->fb->base.pitches[0 ], + plane_config->size); + +/* +* If the fb is shared between multiple heads, we'll just get the +* first one. +*/ +intel_alloc_plane_obj (dev, plane_config, base, fourcc); +} +static bool i9xx_get_pipe_config (struct intel_crtc *crtc,struct intel_crtc_config *pipe_config) {
@@ -10816,6 +10881,7 @@ static void intel_init_display(struct drm_device *dev) dev_priv->display.update_plane = ironlake_update_plane; }else if (IS_VALLEYVIEW (dev)) { dev_priv->display.get_pipe_config = i9xx_get_pipe_config; + dev_priv->display.get_plane_config = i9xx_get_plane_config; dev_priv->display.crtc_mode_set = i9xx_crtc_mode_set; dev_priv->display.crtc_enable = valleyview_crtc_enable; dev_priv->display.crtc_disable = i9xx_crtc_disable;
@@ -10823,6 +10889,7 @@ static void intel_init_display(struct drm_device *dev) dev_priv->display.update_plane = i9xx_update_plane; }else { dev_priv->display.get_pipe_config = i9xx_get_pipe_config; + dev_priv->display.get_plane_config = i9xx_get_plane_config; dev_priv->display.crtc_mode_set = i9xx_crtc_mode_set; dev_priv->display.crtc_enable = i9xx_crtc_enable; dev_priv->display.crtc_disable = i9xx_crtc_disable;
Signature · 1 line
1.7.9.5
PATCH 5/6 drm/i915: get_plane_config support for ILK+ v2
In reply to Jesse BarnesThis should allow BIOS fb inheritance to work on ILK+ machines too.
v2: handle tiled BIOS fbs (Kristian)
split out common bits (Jesse)
--- drivers/gpu/drm/i915/intel_display.c | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)
drivers/gpu/drm/i915/intel_display.c +67 -0
@@ -6585,6 +6585,71 @@ static void ironlake_get_pfit_config(struct intel_crtc *crtc, } } +static void ironlake_get_plane_config (struct intel_crtc *crtc, +struct intel_plane_config *plane_config) +{ +struct drm_device *dev = crtc->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +u32 val, base, offset; +int pipe = crtc->pipe, plane = crtc->plane; +int fourcc, pixel_format; +int aligned_height; + + plane_config->fb =kzalloc (sizeof (*plane_config->fb),GFP_KERNEL ); +if (!plane_config->fb) { +DRM_DEBUG_KMS ("failed to alloc fb\n" ); +return ; + } + + val =I915_READ (DSPCNTR (plane)); + +if (INTEL_INFO (dev)->gen >=4 ) +if (val &DISPPLANE_TILED ) + plane_config->tiled = true; + + pixel_format = val &DISPPLANE_PIXFORMAT_MASK ; + fourcc =intel_format_to_fourcc (pixel_format); + plane_config->fb->base.pixel_format = fourcc; + plane_config->fb->base.bits_per_pixel = +drm_format_plane_cpp (fourcc,0 ) *8 ; + + base =I915_READ (DSPSURF (plane)) &0xfffff000 ; +if (IS_HASWELL (dev) ||IS_BROADWELL (dev)) { + offset =I915_READ (DSPOFFSET (plane)); + }else { +if (plane_config->tiled) + offset =I915_READ (DSPTILEOFF (plane)); +else + offset =I915_READ (DSPLINOFF (plane)); + } + + val =I915_READ (PIPESRC (pipe)); + plane_config->fb->base.width = ((val >>16 ) &0xfff ) +1 ; + plane_config->fb->base.height = ((val >>0 ) &0xfff ) +1 ; + + val =I915_READ (DSPSTRIDE (pipe)); + plane_config->fb->base.pitches[0 ] = val &0xffffff80 ; + + aligned_height =intel_align_height (dev, plane_config->fb->base.height, + plane_config->tiled); + + plane_config->size =ALIGN (plane_config->fb->base.pitches[0 ] * + aligned_height,PAGE_SIZE ); + +DRM_DEBUG_KMS ("pipe/plane %d/%d with fb: size=%dx%d@%d, offset=%x, pitch %d, size 0x%x\n" , + pipe, plane, plane_config->fb->base.width, + plane_config->fb->base.height, + plane_config->fb->base.bits_per_pixel, base, + plane_config->fb->base.pitches[0 ], + plane_config->size); + +/* +* If the fb is shared between multiple heads, we'll just get the +* first one. +*/ +intel_alloc_plane_obj (dev, plane_config, base, fourcc); +} +static bool ironlake_get_pipe_config (struct intel_crtc *crtc,struct intel_crtc_config *pipe_config) {
@@ -10867,6 +10932,7 @@ static void intel_init_display(struct drm_device *dev)if (HAS_DDI (dev)) { dev_priv->display.get_pipe_config = haswell_get_pipe_config; + dev_priv->display.get_plane_config = ironlake_get_plane_config; dev_priv->display.crtc_mode_set = haswell_crtc_mode_set; dev_priv->display.crtc_enable = haswell_crtc_enable; dev_priv->display.crtc_disable = haswell_crtc_disable;
@@ -10874,6 +10940,7 @@ static void intel_init_display(struct drm_device *dev) dev_priv->display.update_plane = ironlake_update_plane; }else if (HAS_PCH_SPLIT (dev)) { dev_priv->display.get_pipe_config = ironlake_get_pipe_config; + dev_priv->display.get_plane_config = ironlake_get_plane_config; dev_priv->display.crtc_mode_set = ironlake_crtc_mode_set; dev_priv->display.crtc_enable = ironlake_crtc_enable; dev_priv->display.crtc_disable = ironlake_crtc_disable;
Signature · 1 line
1.7.9.5
PATCH 6/6 drm/i915: Wrap the preallocated BIOS framebuffer and preserve for KMS fbcon v12
In reply to Jesse BarnesRetrieve current framebuffer config info from the regs and create an fb object for the buffer the BIOS or boot loader left us. This should allow for smooth transitions to userspace apps once we finish the initial configuration construction.
v2: check for non-native modes and adjust (Jesse)
fixup aperture and cmap frees (Imre)
use unlocked unref if init_bios fails (Jesse)
fix curly brace around DSPADDR check (Imre)
comment failure path for pin_and_fence (Imre)
v3: fixup fixup of aperture frees (Chris)
v4: update to current bits (locking & pin_and_fence hack) (Jesse)
v5: move fb config fetch to display code (Jesse)
re-order hw state readout on initial load to suit fb inherit (Jesse) re-add pin_and_fence in fbdev code to make sure we refcount properly (Je
v6: rename to plane_config (Daniel)
check for valid object when initializing BIOS fb (Jesse) split from plane_config readout and other display changes (Jesse) drop use_bios_fb option (Chris)
update comments (Jesse)
rework fbdev_init_bios for clarity (Jesse)
drop fb obj ref under lock (Chris)
v7: use fb object from plane_config instead (Ville)
take ref on fb object (Jesse)
v8: put under i915_fastboot option (Jesse)
fix fb ptr checking (Jesse)
inform drm_fb_helper if we fail to enable a connector (Jesse) drop unnecessary enabled[] modifications in failure cases (Chris) split from BIOS connector config readout (Daniel)
don't memset the fb buffer if preallocated (Chris)
alloc ifbdev up front and pass to init_bios (Chris)
check for bad ifbdev in restore_mode too (Chris)
v9: fix up !fastboot bpp setting (Jesse)
fix up !fastboot helper alloc (Jesse)
make sure BIOS fb is sufficient for biggest active pipe (Jesse)
v10:fix up size calculation for proposed fbs (Chris)
go back to two pass pipe fb assignment (Chris)
add warning for active pipes w/o fbs (Chris)
clean up num_pipes checks in fbdev_init and fbdev_restore_mode (Chris) move i915.fastboot into fbdev_init (Chris)
v11:make BIOS connector config usage unconditional (Daniel) v12:fix up fb vs pipe size checking (Chris)
--- drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_fbdev.c | 174 ++++++++++++++++++++++++++++++++++-- 2 files changed, 166 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/intel_drv.h +1 -0
@@ -113,6 +113,7 @@ struct intel_fbdev {struct intel_framebuffer *fb;struct list_head fbdev_list;struct drm_display_mode *our_mode; +int preferred_bpp; };struct intel_encoder {
drivers/gpu/drm/i915/intel_fbdev.c +165 -9
234 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Re: [PATCH 6/6] drm/i915: Wrap the preallocated BIOS framebuffer and preserve for KMS fbcon v12
Quoted 8 lines · Jesse Barnes
drivers/gpu/drm/i915/intel_fbdev.c +8
-0+/* Find the largest fb */ +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { + intel_crtc =to_intel_crtc (crtc); + +if (!intel_crtc->active || !intel_crtc->plane_config.fb) { +DRM_DEBUG_KMS ("pipe %c not active or no fb, skipping\n" , +pipe_name (intel_crtc->pipe)); +continue ;
drivers/gpu/drm/i915/intel_fbdev.c static void intel_fbdev_destroy(struct drm_device *dev, · line 434
Quoted 10 lines
drivers/gpu/drm/i915/intel_fbdev.c +10
-0+ } + +if (intel_crtc->plane_config.size > max_size) { +DRM_DEBUG_KMS ("found possible fb from plane %c\n" , +pipe_name (intel_crtc->pipe)); + plane_config = &intel_crtc->plane_config; + fb = plane_config->fb; + max_size = plane_config->size; + } + }
I had another idea... Can you select the fb with offset 0 first and see if that fits every pipe? That way we reduce the potential fragmentation from the permanently pinned in-aperture object.
Quoted 23 lines
drivers/gpu/drm/i915/intel_fbdev.c +23
-0+ +if (!fb) { +DRM_DEBUG_KMS ("no active fbs found, not using BIOS config\n" ); + goto out; + } + +/* Now make sure all the pipes will fit into it */ +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { +unsigned int cur_size; + + intel_crtc =to_intel_crtc (crtc); + +if (!intel_crtc->active) { +DRM_DEBUG_KMS ("pipe %c not active, skipping\n" , +pipe_name (intel_crtc->pipe)); +continue ; + } + +DRM_DEBUG_KMS ("checking plane %c for BIOS fb\n" , +pipe_name (intel_crtc->pipe)); + +/* +* See if the plane fb we found above will fit on this
drivers/gpu/drm/i915/intel_fbdev.c static void intel_fbdev_destroy(struct drm_device *dev, · line 467
Quoted 10 lines
drivers/gpu/drm/i915/intel_fbdev.c +10
-0+* pipe. Note we need to use the selected fb's bpp rather +* than the current pipe's, since they could be different. +*/ + cur_size = intel_crtc->config.adjusted_mode.crtc_hdisplay * + intel_crtc->config.adjusted_mode.crtc_vdisplay; +DRM_DEBUG_KMS ("pipe %c area: %d\n" ,pipe_name (intel_crtc->pipe), + cur_size); + cur_size *= fb->base.bits_per_pixel /8 ; +DRM_DEBUG_KMS ("total size %d (bpp %d)\n" , cur_size, + fb->base.bits_per_pixel /8 );
But the display hardware will be using the stride from the fb, so the end of the last row will still be vdisplay*fb->stride, right? Unless the fb pitch itself is recomputed to match?
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Re: [PATCH 6/6] drm/i915: Wrap the preallocated BIOS framebuffer and preserve for KMS fbcon v12
Quoted 15 lines · On Wed, 12 Feb 2014 23:07:15 +0000 Chris Wilson <[email protected]>…
Quoted 14 lines · Jesse Barnes
drivers/gpu/drm/i915/intel_fbdev.c +14
-0+/* Find the largest fb */ +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { + intel_crtc =to_intel_crtc (crtc); + +if (!intel_crtc->active || !intel_crtc->plane_config.fb) { +DRM_DEBUG_KMS ("pipe %c not active or no fb, skipping\n" , +pipe_name (intel_crtc->pipe)); +continue ; + } + +if (intel_crtc->plane_config.size > max_size) { +DRM_DEBUG_KMS ("found possible fb from plane %c\n" , +pipe_name (intel_crtc->pipe)); + plane_config = &intel_crtc->plane_config;
Quoted 8 lines
drivers/gpu/drm/i915/intel_fbdev.c static void intel_fbdev_destroy(struct drm_device *dev, · line 434
Quoted 4 lines
drivers/gpu/drm/i915/intel_fbdev.c +4
-0+ fb = plane_config->fb; + max_size = plane_config->size; + } + }I had another idea... Can you select the fb with offset 0 first and see if that fits every pipe? That way we reduce the potential fragmentation from the permanently pinned in-aperture object.
So if they happen to be the same size we'll prefer the one at 0? I guess we can tweak this all sorts of ways... but we'll generally probably only have a single buffer from the BIOS, so I'm not sure it'll make much difference in practice.
Quoted 29 lines
Quoted 29 lines
drivers/gpu/drm/i915/intel_fbdev.c +29
-0+ +if (!fb) { +DRM_DEBUG_KMS ("no active fbs found, not using BIOS config\n" ); + goto out; + } + +/* Now make sure all the pipes will fit into it */ +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { +unsigned int cur_size; + + intel_crtc =to_intel_crtc (crtc); + +if (!intel_crtc->active) { +DRM_DEBUG_KMS ("pipe %c not active, skipping\n" , +pipe_name (intel_crtc->pipe)); +continue ; + } + +DRM_DEBUG_KMS ("checking plane %c for BIOS fb\n" , +pipe_name (intel_crtc->pipe)); + +/* +* See if the plane fb we found above will fit on this +* pipe. Note we need to use the selected fb's bpp rather +* than the current pipe's, since they could be different. +*/ + cur_size = intel_crtc->config.adjusted_mode.crtc_hdisplay * + intel_crtc->config.adjusted_mode.crtc_vdisplay; + DRM_DEBUG_KMS("pipe %c area: %d\n", pipe_name(intel_crtc->pipe),
Quoted 8 lines
drivers/gpu/drm/i915/intel_fbdev.c static void intel_fbdev_destroy(struct drm_device *dev, · line 467
Quoted 4 lines
drivers/gpu/drm/i915/intel_fbdev.c +4
-0+ cur_size); + cur_size *= fb->base.bits_per_pixel /8 ; +DRM_DEBUG_KMS ("total size %d (bpp %d)\n" , cur_size, + fb->base.bits_per_pixel /8 );But the display hardware will be using the stride from the fb, so the end of the last row will still be vdisplay*fb->stride, right? Unless the fb pitch itself is recomputed to match?
I think there are two cases:
1) pipe A re-uses plane A's fb - no changes needed, should match nicely
2) pipe B switches to plane A's fb - we'll end up doing a set_base and switching the stride bits and depth over to the plane A fb params, so it should work
right?
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center