Lines Matching refs:gr
301 hud_draw_graph_line_strip(struct hud_context *hud, const struct hud_graph *gr, in hud_draw_graph_line_strip() argument
304 if (gr->num_vertices <= 1) in hud_draw_graph_line_strip()
307 assert(gr->index <= gr->num_vertices); in hud_draw_graph_line_strip()
310 gr->vertices, gr->index, in hud_draw_graph_line_strip()
311 gr->color[0], gr->color[1], gr->color[2], 1, in hud_draw_graph_line_strip()
312 xoffset + (gr->pane->max_num_vertices - gr->index - 1) * 2 - 1, in hud_draw_graph_line_strip()
315 if (gr->num_vertices <= gr->index) in hud_draw_graph_line_strip()
319 gr->vertices + gr->index*2, in hud_draw_graph_line_strip()
320 gr->num_vertices - gr->index, in hud_draw_graph_line_strip()
321 gr->color[0], gr->color[1], gr->color[2], 1, in hud_draw_graph_line_strip()
322 xoffset - gr->index*2 - 1, yoffset, yscale); in hud_draw_graph_line_strip()
329 struct hud_graph *gr; in hud_pane_accumulate_vertices() local
354 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_pane_accumulate_vertices()
358 number_to_human_readable(gr->current_value, pane->type, str); in hud_pane_accumulate_vertices()
359 hud_draw_string(hud, x, y, " %s: %s", gr->name, str); in hud_pane_accumulate_vertices()
404 struct hud_graph *gr; in hud_pane_accumulate_vertices_simple() local
410 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_pane_accumulate_vertices_simple()
414 number_to_human_readable(gr->current_value, pane->type, str); in hud_pane_accumulate_vertices_simple()
415 hud_draw_string(hud, x, y, "%s: %s", gr->name, str); in hud_pane_accumulate_vertices_simple()
424 struct hud_graph *gr; in hud_pane_draw_colored_objects() local
429 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_pane_draw_colored_objects()
434 gr->color[0], gr->color[1], gr->color[2], 1); in hud_pane_draw_colored_objects()
439 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_pane_draw_colored_objects()
440 hud_draw_graph_line_strip(hud, gr, pane->inner_x1, pane->inner_y2, pane->yscale); in hud_pane_draw_colored_objects()
629 struct hud_graph *gr; in hud_start_queries() local
635 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_start_queries()
636 if (gr->begin_query) in hud_start_queries()
637 gr->begin_query(gr, pipe); in hud_start_queries()
647 struct hud_graph *gr, *next; in hud_stop_queries() local
683 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_stop_queries()
684 gr->query_new_value(gr, pipe); in hud_stop_queries()
688 LIST_FOR_EACH_ENTRY_SAFE(gr, next, &pane->graph_list, head) { in hud_stop_queries()
690 if (&gr->head == pane->graph_list.prev) in hud_stop_queries()
696 if (gr->current_value < in hud_stop_queries()
698 list_del(&gr->head); in hud_stop_queries()
699 list_add(&gr->head, &next->head); in hud_stop_queries()
843 hud_pane_update_dyn_ceiling(struct hud_graph *gr, struct hud_pane *pane) in hud_pane_update_dyn_ceiling() argument
848 if (pane->dyn_ceil_last_ran != gr->index) { in hud_pane_update_dyn_ceiling()
849 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_pane_update_dyn_ceiling()
850 for (i = 0; i < gr->num_vertices; ++i) { in hud_pane_update_dyn_ceiling()
851 tmp = gr->vertices[i * 2 + 1] > tmp ? in hud_pane_update_dyn_ceiling()
852 gr->vertices[i * 2 + 1] : tmp; in hud_pane_update_dyn_ceiling()
865 pane->dyn_ceil_last_ran = gr->index; in hud_pane_update_dyn_ceiling()
920 hud_pane_add_graph(struct hud_pane *pane, struct hud_graph *gr) in hud_pane_add_graph() argument
941 strip_hyphens(gr->name); in hud_pane_add_graph()
943 gr->vertices = MALLOC(pane->max_num_vertices * sizeof(float) * 2); in hud_pane_add_graph()
944 gr->color[0] = colors[color][0]; in hud_pane_add_graph()
945 gr->color[1] = colors[color][1]; in hud_pane_add_graph()
946 gr->color[2] = colors[color][2]; in hud_pane_add_graph()
947 gr->pane = pane; in hud_pane_add_graph()
948 list_addtail(&gr->head, &pane->graph_list); in hud_pane_add_graph()
954 hud_graph_add_value(struct hud_graph *gr, double value) in hud_graph_add_value() argument
956 gr->current_value = value; in hud_graph_add_value()
957 value = value > gr->pane->ceiling ? gr->pane->ceiling : value; in hud_graph_add_value()
959 if (gr->fd) { in hud_graph_add_value()
961 fprintf(gr->fd, "%f\n", value); in hud_graph_add_value()
964 fprintf(gr->fd, "%" PRIu64 "\n", (uint64_t) lround(value)); in hud_graph_add_value()
968 if (gr->index == gr->pane->max_num_vertices) { in hud_graph_add_value()
969 gr->vertices[0] = 0; in hud_graph_add_value()
970 gr->vertices[1] = gr->vertices[(gr->index-1)*2+1]; in hud_graph_add_value()
971 gr->index = 1; in hud_graph_add_value()
973 gr->vertices[(gr->index)*2+0] = (float) (gr->index * 2); in hud_graph_add_value()
974 gr->vertices[(gr->index)*2+1] = (float) value; in hud_graph_add_value()
975 gr->index++; in hud_graph_add_value()
977 if (gr->num_vertices < gr->pane->max_num_vertices) { in hud_graph_add_value()
978 gr->num_vertices++; in hud_graph_add_value()
981 if (gr->pane->dyn_ceiling == true) { in hud_graph_add_value()
982 hud_pane_update_dyn_ceiling(gr, gr->pane); in hud_graph_add_value()
984 if (value > gr->pane->max_value) { in hud_graph_add_value()
985 hud_pane_set_max_value(gr->pane, value); in hud_graph_add_value()
1038 hud_graph_set_dump_file(struct hud_graph *gr) in hud_graph_set_dump_file() argument
1044 + sizeof(gr->name)); in hud_graph_set_dump_file()
1048 strcat_without_spaces(dump_file, gr->name); in hud_graph_set_dump_file()
1049 gr->fd = fopen(dump_file, "w+"); in hud_graph_set_dump_file()
1050 if (gr->fd) { in hud_graph_set_dump_file()
1052 setvbuf(gr->fd, NULL, _IOLBF, 0); in hud_graph_set_dump_file()
1504 struct hud_graph *gr; in hud_parse_env_var() local
1506 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_parse_env_var()
1507 hud_graph_set_dump_file(gr); in hud_parse_env_var()