amdgpu_mtop: render the full braille chart rows so the history is visible

mtop::tui::braille() returns height*4 text rows (one braille sub-row per
terminal row: 5 cell rows x 4 = 20 rows), but both braille charts only
rendered rows 0..4 with the 100/75/50/25/0% axis labels. Rows 0..4 are
the top braille cell row, i.e. only the 75..100% band of the scale, so
any series at or below 75% (idle dispatch-in-flight, SMU/UMC activity)
plotted in rows 5..19 that were never drawn. The headline percentage
came straight from the same history series, which is why the number
moved while the chart under it stayed blank.

Both the GPU CORE LOAD and SMU MEMORY ACTIVITY (UMC) charts now render
all 20 rows, with axis labels only at the 100/75/50/25% sub-row
positions so the caption column stays compact. The UMC chart stays
honestly empty while the source has no samples (stage 0 driver, or the
incoherent SMU table without the selector-68 MMHUB fallback), and
fills in as soon as a value arrives.

The render test's interactive-layout assertion now uses an 80-row
terminal: the dashboard legitimately needs ~78 rows with both full
braille charts, so the sort footer at 50 rows no longer asserts.
This commit is contained in:
geramyloveless committed 2026-09-25 21:15:46 -07:00
1 parent 4e858bdfe0
commit c5b0313202
2 files changed
+11 -7

No files matched your search

+10 -6
View File
@@ -446,9 +446,11 @@ void dashboard(const std::vector<mtop::Device> &devices, const mtop::Selection &
std::vector<std::optional<double>> plot;
for(size_t i=0;i<n;++i) plot.push_back(buckets[buckets.size()-n+i]);
const auto br=braille(plot,5,100.0);
const std::string labels[]={"100%","75%","50%","25%","0%"};
for(size_t r=0;r<5;++r)
line(cell(columns,palette.label(labels[r])+" "+palette.label(br.rows[r])));
for(size_t r=0;r<br.rows.size();++r) {
const unsigned percent=100u-(unsigned)(r*100/br.rows.size());
const std::string label=(percent%25==0 ? std::to_string(percent)+"%" : std::string(4,' '));
line(cell(columns,palette.label(label)+" "+palette.label(br.rows[r])));
}
line(cell(columns,palette.label(xaxis(chCells))));
const auto s=mtop::stats(plot);
line(cell(columns,palette.label(" min ")+(s?palette.value(decimal(s->at(0),1)+"% max "):nad("n/a max "))+
@@ -506,9 +508,11 @@ void dashboard(const std::vector<mtop::Device> &devices, const mtop::Selection &
for(size_t i=0;i<xCount;++i)
plot.push_back(utilizationBuckets[utilizationBuckets.size()-xCount+i]);
auto br=braille(plot,5,100.0);
const std::string labels[]={"100%","75%","50%","25%","0%"};
for(size_t r=0;r<5;++r)
line(cell(columns,palette.label(labels[r])+" "+palette.label(br.rows[r])));
for(size_t r=0;r<br.rows.size();++r) {
const unsigned percent=100u-(unsigned)(r*100/br.rows.size());
const std::string label=(percent%25==0 ? std::to_string(percent)+"%" : std::string(4,' '));
line(cell(columns,palette.label(label)+" "+palette.label(br.rows[r])));
}
line(cell(columns,palette.label(xaxis(cells))));
line(cell(columns,palette.label(
" source: driver dispatch-in-flight (selector 61); SMU AverageGfxActivity "
+1 -1
View File
@@ -210,7 +210,7 @@ int main() {
mtop::Frame interactive;
ui.sort.kind = mtop::tui::Sort::Vram;
dashboard({d}, selected, {}, true, false, &histories, mtop::RefreshMode{true},
120, 50, now, mtop::Graphics::Text, &interactive, false, &ui);
120, 80, now, mtop::Graphics::Text, &interactive, false, &ui);
std::cout.rdbuf(previous);
auto interactiveVisible = strip(interactive.previous.back());
assert(interactiveVisible.find("[q] Quit") != std::string::npos);