drm/i915/skl: Add check for minimum allocable Display Data Blocks
Subsystems (2)
PATCH 1/1 drm/i915/skl: Add check for minimum allocable Display Data Blocks
Fifo Underrun is observed when allocating < minimum allocable blocks for any plane, This patch calculate & checks for upper & lower DDB bound for each plane according to total allocated DDB for that Pipe.
--- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/intel_pm.c | 48 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -1536,6 +1536,8 @@ struct skl_ddb_allocation {struct skl_ddb_entry pipe[I915_MAX_PIPES ];struct skl_ddb_entry plane[I915_MAX_PIPES ][I915_MAX_PLANES ];struct skl_ddb_entry cursor[I915_MAX_PIPES ]; +uint16_t min_alloc[I915_MAX_PIPES ][I915_MAX_PLANES ]; +uint16_t max_alloc[I915_MAX_PIPES ][I915_MAX_PLANES ]; };struct skl_wm_values {
drivers/gpu/drm/i915/intel_pm.c +48 -0
66 lines not on this page · raw message
Signature · 6 lines
2.3.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 5 lines · Mahesh
Fifo Underrun is observed when allocating < minimum allocable blocks for any plane, This patch calculate & checks for upper & lower DDB bound for each plane according to total allocated DDB for that Pipe.
Signed-off-by Kumar, Mahesh <[email protected]>
Hi,
It seems that my fix for that got lost (sigh):
http://lists.freedesktop.org/archives/intel-gfx/2014-October/053713.html
Would you mind reviewing that one instead?
Signature · 1 line
Damien
Quoted 98 lines
--- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/intel_pm.c | 48 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+)drivers/gpu/drm/i915/i915_drv.h +2
-0@@ -1536,6 +1536,8 @@ struct skl_ddb_allocation {struct skl_ddb_entry pipe[I915_MAX_PIPES ];struct skl_ddb_entry plane[I915_MAX_PIPES ][I915_MAX_PLANES ];struct skl_ddb_entry cursor[I915_MAX_PIPES ]; +uint16_t min_alloc[I915_MAX_PIPES ][I915_MAX_PLANES ]; +uint16_t max_alloc[I915_MAX_PIPES ][I915_MAX_PLANES ]; };struct skl_wm_values {drivers/gpu/drm/i915/intel_pm.c +48
-0@@ -2482,6 +2482,43 @@ skl_get_total_relative_data_rate(struct intel_crtc *intel_crtc, }static void +skl_calculate_allocable_blocks (struct intel_crtc *intel_crtc, +const struct skl_pipe_wm_parameters *params, +uint16_t alloc_size,struct skl_ddb_allocation *ddb) +{ +uint16_t min; +uint16_t total_min_alloc =0 ; +enum pipe pipe = intel_crtc->pipe; +int plane; + +for (plane =0 ; plane <intel_num_planes (intel_crtc); plane++) { +const struct intel_plane_wm_parameters *p; + + p = ¶ms->plane[plane]; + ddb->min_alloc[pipe][plane] =0 ; + +if (!p->enabled) +continue ; + +/* +* TODO: Calculate PlaneMinAlloc according to X/Y-Tiling +* calculation, for now use X-Tiling PlaneMinAlloc +*/ + + min =8 ; + + ddb->min_alloc[pipe][plane] = min; + total_min_alloc += min; + + } + +for (plane =0 ; plane <intel_num_planes (intel_crtc); plane++) { + ddb->max_alloc[pipe][plane] = alloc_size - total_min_alloc + + ddb->min_alloc[pipe][plane]; + } +} + +static void skl_allocate_pipe_ddb(struct drm_crtc *crtc, const struct intel_wm_config *config, const struct skl_pipe_wm_parameters *params,@@ -2519,6 +2556,8 @@ skl_allocate_pipe_ddb(struct drm_crtc *crtc, total_data_rate =skl_get_total_relative_data_rate (intel_crtc, params); start = alloc->start; + +skl_calculate_allocable_blocks (intel_crtc, params, alloc_size, ddb);for (plane =0 ; plane <intel_num_planes (intel_crtc); plane++) {const struct intel_plane_wm_parameters *p;unsigned int data_rate;@@ -2537,6 +2576,15 @@ skl_allocate_pipe_ddb(struct drm_crtc *crtc, plane_blocks =div_u64 ((uint64_t )alloc_size * data_rate, total_data_rate); +/* +* Limit plane_blocks if out of limit +*/ + +if (plane_blocks > ddb->max_alloc[pipe][plane]) + plane_blocks = ddb->max_alloc[pipe][plane]; +if (plane_blocks < ddb->min_alloc[pipe][plane]) + plane_blocks = ddb->min_alloc[pipe][plane]; + ddb->plane[pipe][plane].start = start; ddb->plane[pipe][plane].end = start + plane_blocks;Signature · 6 lines
2.3.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/1 drm/i915/skl: Make sure to allocate mininum sizes in the DDB
I overlooked the fact that we need to allocate a minimum 8 blocks and that just allocating the planes depending on how much they need to fetch from the DDB in proportion of how much memory bw is necessary for the whole display can lead to cases where we don't respect those minima (and thus overrun).
So, instead, start by allocating 8 blocks to each active display plane and then allocate the remaining blocks like before.
v2: Rebase on top of -nightly
--- drivers/gpu/drm/i915/intel_pm.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +18 -4
@@ -2502,6 +2502,7 @@ skl_allocate_pipe_ddb(struct drm_crtc *crtc,enum pipe pipe = intel_crtc->pipe;struct skl_ddb_entry *alloc = &ddb->pipe[pipe];uint16_t alloc_size, start, cursor_blocks; +uint16_t minimum[I915_MAX_PLANES ];unsigned int total_data_rate;int plane;
@@ -2520,9 +2521,21 @@ skl_allocate_pipe_ddb(struct drm_crtc *crtc, alloc_size -= cursor_blocks; alloc->end -= cursor_blocks; +/* 1. Allocate the mininum required blocks for each active plane */ +for_each_plane (pipe, plane) { +const struct intel_plane_wm_parameters *p; + + p = ¶ms->plane[plane]; +if (!p->enabled) +continue ; + + minimum[plane] =8 ; + alloc_size -= minimum[plane]; + } +/* -* Each active plane get a portion of the remaining space, in -* proportion to the amount of data they need to fetch from memory. +* 2. Distribute the remaining space in proportion to the amount of +* data each plane needs to fetch from memory. * * FIXME: we may not allocate every single block here. */
@@ -2544,8 +2557,9 @@ skl_allocate_pipe_ddb(struct drm_crtc *crtc,* promote the expression to 64 bits to avoid overflowing, the * result is < available as data_rate / total_data_rate < 1 */ - plane_blocks =div_u64 ((uint64_t )alloc_size * data_rate, - total_data_rate); + plane_blocks = minimum[plane]; + plane_blocks +=div_u64 ((uint64_t )alloc_size * data_rate, + total_data_rate); ddb->plane[pipe][plane].start = start; ddb->plane[pipe][plane].end = start + plane_blocks;
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2] drm/i915/skl: Make sure to allocate mininum sizes in the DDB
Quoted 54 lines · Damien Lespiau
I overlooked the fact that we need to allocate a minimum 8 blocks and that just allocating the planes depending on how much they need to fetch from the DDB in proportion of how much memory bw is necessary for the whole display can lead to cases where we don't respect those minima (and thus overrun).
So, instead, start by allocating 8 blocks to each active display plane and then allocate the remaining blocks like before.
v2: Rebase on top of -nightly
Cc Mahesh Kumar <[email protected]>Signed-off-by Damien Lespiau <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_pm.c +15
-2@@ -2502,6 +2502,7 @@ skl_allocate_pipe_ddb(struct drm_crtc *crtc,enum pipe pipe = intel_crtc->pipe;struct skl_ddb_entry *alloc = &ddb->pipe[pipe];uint16_t alloc_size, start, cursor_blocks; +uint16_t minimum[I915_MAX_PLANES ];unsigned int total_data_rate;int plane;@@ -2520,9 +2521,21 @@ skl_allocate_pipe_ddb(struct drm_crtc *crtc, alloc_size -= cursor_blocks; alloc->end -= cursor_blocks; +/* 1. Allocate the mininum required blocks for each active plane */ +for_each_plane (pipe, plane) { +const struct intel_plane_wm_parameters *p; + + p = ¶ms->plane[plane]; +if (!p->enabled) +continue ; + + minimum[plane] =8 ; + alloc_size -= minimum[plane]; + } +/* -* Each active plane get a portion of the remaining space, in -* proportion to the amount of data they need to fetch from memory. +* 2. Distribute the remaining space in proportion to the amount of +* data each plane needs to fetch from memory. * * FIXME: we may not allocate every single block here. */
drivers/gpu/drm/i915/intel_pm.c skl_allocate_pipe_ddb(struct drm_crtc *crtc, · line 2562
Quoted 8 lines
drivers/gpu/drm/i915/intel_pm.c +3
-2@@ -2544,8 +2557,9 @@ skl_allocate_pipe_ddb(struct drm_crtc *crtc,* promote the expression to 64 bits to avoid overflowing, the * result is < available as data_rate / total_data_rate < 1 */ - plane_blocks =div_u64 ((uint64_t )alloc_size * data_rate, - total_data_rate); + plane_blocks = minimum[plane]; + plane_blocks +=div_u64 ((uint64_t )alloc_size * data_rate, + total_data_rate);
The minimum[] array seems pointless. The value here is always going to be 8.
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +0
-0ddb->plane[pipe][plane].start = start; ddb->plane[pipe][plane].end = start + plane_blocks;Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2] drm/i915/skl: Make sure to allocate mininum sizes in the DDB
Quoted 4 lines · Ville Syrjälä
Quoted 4 lines
drivers/gpu/drm/i915/intel_pm.c +0
-0@@ -2544,8 +2557,9 @@ skl_allocate_pipe_ddb(struct drm_crtc *crtc,* promote the expression to 64 bits to avoid overflowing, the * result is < available as data_rate / total_data_rate < 1 */
Quoted 8 lines
drivers/gpu/drm/i915/intel_pm.c skl_allocate_pipe_ddb(struct drm_crtc *crtc, · line 2562
Quoted 5 lines
drivers/gpu/drm/i915/intel_pm.c +3
-2- plane_blocks =div_u64 ((uint64_t )alloc_size * data_rate, - total_data_rate); + plane_blocks = minimum[plane]; + plane_blocks +=div_u64 ((uint64_t )alloc_size * data_rate, + total_data_rate);The minimum[] array seems pointless. The value here is always going to be 8.
Not in the future with new features appearing.
Signature · 5 lines
Damien _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2] drm/i915/skl: Make sure to allocate mininum sizes in the DDB
In reply to Damien LespiauTask id: 5732 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
PNV 282/283 282/283 ILK 308/319 308/319 SNB +1-3 340/346 338/346 IVB +1-2 378/384 377/384
BYT 296/296 296/296
HSW +1 421/428 422/428
BDW 318/333 318/333
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
*SNB igt_kms_flip_dpms-vs-vblank-race PASS(3, M22) DMESG_WARN(1, M22) SNB igt_kms_flip_dpms-vs-vblank-race-interruptible DMESG_WARN(3, M22)PASS(1, M22) DMESG_WARN(1, M22) SNB igt_kms_flip_modeset-vs-vblank-race-interruptible DMESG_WARN(1, M22)PASS(2, M22) DMESG_WARN(1, M22) SNB igt_kms_pipe_crc_basic_read-crc-pipe-A DMESG_WARN(1, M22)PASS(4, M22) PASS(1, M22) *IVB igt_gem_pwrite_pread_snooped-copy-performance PASS(2, M34) DMESG_WARN(1, M34) IVB igt_gem_storedw_batches_loop_normal DMESG_WARN(1, M34)PASS(1, M34) PASS(1, M34) IVB igt_gem_storedw_batches_loop_secure-dispatch DMESG_WARN(1, M34)PASS(1, M34) DMESG_WARN(1, M34) HSW igt_gem_storedw_loop_blt DMESG_WARN(2, M20)PASS(1, M20) PASS(1, M20)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2] drm/i915/skl: Make sure to allocate mininum sizes in the DDB
In reply to Damien LespiauQuoted 6 lines · Damien Lespiau
I overlooked the fact that we need to allocate a minimum 8 blocks and that just allocating the planes depending on how much they need to fetch from the DDB in proportion of how much memory bw is necessary for the whole display can lead to cases where we don't respect those minima (and thus overrun).
Quoted 7 lines
So, instead, start by allocating 8 blocks to each active display plane and then allocate the remaining blocks like before.
v2: Rebase on top of -nightly
Cc Mahesh Kumar <[email protected]>Signed-off-by Damien Lespiau <[email protected]>
OK after reading through the spec the minimum[] thing makes sense, so
Quoted 59 lines
--- drivers/gpu/drm/i915/intel_pm.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_pm.c +18
-4@@ -2502,6 +2502,7 @@ skl_allocate_pipe_ddb(struct drm_crtc *crtc,enum pipe pipe = intel_crtc->pipe;struct skl_ddb_entry *alloc = &ddb->pipe[pipe];uint16_t alloc_size, start, cursor_blocks; +uint16_t minimum[I915_MAX_PLANES ];unsigned int total_data_rate;int plane;@@ -2520,9 +2521,21 @@ skl_allocate_pipe_ddb(struct drm_crtc *crtc, alloc_size -= cursor_blocks; alloc->end -= cursor_blocks; +/* 1. Allocate the mininum required blocks for each active plane */ +for_each_plane (pipe, plane) { +const struct intel_plane_wm_parameters *p; + + p = ¶ms->plane[plane]; +if (!p->enabled) +continue ; + + minimum[plane] =8 ; + alloc_size -= minimum[plane]; + } +/* -* Each active plane get a portion of the remaining space, in -* proportion to the amount of data they need to fetch from memory. +* 2. Distribute the remaining space in proportion to the amount of +* data each plane needs to fetch from memory. * * FIXME: we may not allocate every single block here. */ @@ -2544,8 +2557,9 @@ skl_allocate_pipe_ddb(struct drm_crtc *crtc,* promote the expression to 64 bits to avoid overflowing, the * result is < available as data_rate / total_data_rate < 1 */ - plane_blocks =div_u64 ((uint64_t )alloc_size * data_rate, - total_data_rate); + plane_blocks = minimum[plane]; + plane_blocks +=div_u64 ((uint64_t )alloc_size * data_rate, + total_data_rate); ddb->plane[pipe][plane].start = start; ddb->plane[pipe][plane].end = start + plane_blocks;Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter
AppliedRe: [PATCH v2] drm/i915/skl: Make sure to allocate mininum sizes in the DDB
Quoted 10 lines · Ville Syrjälä
Quoted 9 lines · Damien Lespiau
I overlooked the fact that we need to allocate a minimum 8 blocks and that just allocating the planes depending on how much they need to fetch from the DDB in proportion of how much memory bw is necessary for the whole display can lead to cases where we don't respect those minima (and thus overrun).
So, instead, start by allocating 8 blocks to each active display plane and then allocate the remaining blocks like before.
Quoted 7 lines
Quoted 4 lines
v2: Rebase on top of -nightly
Cc Mahesh Kumar <[email protected]>Signed-off-by Damien Lespiau <[email protected]>OK after reading through the spec the minimum[] thing makes sense, so
Reviewed-by Ville Syrjälä <[email protected]>
Queued for -next, thanks for the patch.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx