drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c- Extension
.c- Size
- 67733 bytes
- Lines
- 1926
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
dml1_display_rq_dlg_calc.hdisplay_mode_lib.hdml_inline_defs.h
Detected Declarations
function filesfunction is_dual_planefunction get_blk256_sizefunction get_refcyc_per_deliveryfunction get_vratio_prefunction get_swath_needfunction get_blk_size_bytesfunction extract_rq_sizing_regsfunction dml1_extract_rq_regsfunction handle_det_buf_splitfunction dml1_rq_dlg_get_row_heightsfunction get_surf_rq_paramfunction ptesfunction dml1_rq_dlg_get_rq_paramsfunction dml1_rq_dlg_get_dlg_params
Annotated Snippet
if (total_swath_bytes <= detile_buf_size_in_bytes) { /*full 256b request */
req128_l = 0;
req128_c = 0;
swath_bytes_l = full_swath_bytes_packed_l;
swath_bytes_c = full_swath_bytes_packed_c;
} else { /*128b request (for luma only for yuv420 8bpc) */
req128_l = 1;
req128_c = 0;
swath_bytes_l = full_swath_bytes_packed_l / 2;
swath_bytes_c = full_swath_bytes_packed_c;
}
/* Bug workaround, luma and chroma req size needs to be the same. (see: DEGVIDCN10-137)
* TODO: Remove after rtl fix
*/
if (req128_l == 1) {
req128_c = 1;
DTRACE("DLG: %s: bug workaround DEGVIDCN10-137", __func__);
}
/* Note: assumption, the config that pass in will fit into
* the detiled buffer.
*/
} else {
total_swath_bytes = 2 * full_swath_bytes_packed_l;
if (total_swath_bytes <= detile_buf_size_in_bytes)
req128_l = 0;
else
req128_l = 1;
swath_bytes_l = total_swath_bytes;
swath_bytes_c = 0;
}
rq_param->misc.rq_l.stored_swath_bytes = swath_bytes_l;
rq_param->misc.rq_c.stored_swath_bytes = swath_bytes_c;
if (surf_linear) {
log2_swath_height_l = 0;
log2_swath_height_c = 0;
} else {
unsigned int swath_height_l;
unsigned int swath_height_c;
if (!surf_vert) {
swath_height_l = rq_param->misc.rq_l.blk256_height;
swath_height_c = rq_param->misc.rq_c.blk256_height;
} else {
swath_height_l = rq_param->misc.rq_l.blk256_width;
swath_height_c = rq_param->misc.rq_c.blk256_width;
}
if (swath_height_l > 0)
log2_swath_height_l = dml_log2(swath_height_l);
if (req128_l && log2_swath_height_l > 0)
log2_swath_height_l -= 1;
if (swath_height_c > 0)
log2_swath_height_c = dml_log2(swath_height_c);
if (req128_c && log2_swath_height_c > 0)
log2_swath_height_c -= 1;
}
rq_param->dlg.rq_l.swath_height = 1 << log2_swath_height_l;
rq_param->dlg.rq_c.swath_height = 1 << log2_swath_height_c;
DTRACE("DLG: %s: req128_l = %0d", __func__, req128_l);
DTRACE("DLG: %s: req128_c = %0d", __func__, req128_c);
DTRACE("DLG: %s: full_swath_bytes_packed_l = %0d", __func__, full_swath_bytes_packed_l);
DTRACE("DLG: %s: full_swath_bytes_packed_c = %0d", __func__, full_swath_bytes_packed_c);
}
/* Need refactor. */
static void dml1_rq_dlg_get_row_heights(
struct display_mode_lib *mode_lib,
unsigned int *o_dpte_row_height,
unsigned int *o_meta_row_height,
unsigned int vp_width,
unsigned int data_pitch,
int source_format,
int tiling,
int macro_tile_size,
int source_scan,
int is_chroma)
{
bool surf_linear = (tiling == dm_sw_linear);
bool surf_vert = (source_scan == dm_vert);
Annotation
- Immediate include surface: `dml1_display_rq_dlg_calc.h`, `display_mode_lib.h`, `dml_inline_defs.h`.
- Detected declarations: `function files`, `function is_dual_plane`, `function get_blk256_size`, `function get_refcyc_per_delivery`, `function get_vratio_pre`, `function get_swath_need`, `function get_blk_size_bytes`, `function extract_rq_sizing_regs`, `function dml1_extract_rq_regs`, `function handle_det_buf_split`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.