Lines Matching full:gr

299 hud_draw_graph_line_strip(struct hud_context *hud, const struct hud_graph *gr,  in hud_draw_graph_line_strip()  argument
302 if (gr->num_vertices <= 1) in hud_draw_graph_line_strip()
305 assert(gr->index <= gr->num_vertices); in hud_draw_graph_line_strip()
308 gr->vertices, gr->index, in hud_draw_graph_line_strip()
309 gr->color[0], gr->color[1], gr->color[2], 1, in hud_draw_graph_line_strip()
310 xoffset + (gr->pane->max_num_vertices - gr->index - 1) * 2 - 1, in hud_draw_graph_line_strip()
313 if (gr->num_vertices <= gr->index) in hud_draw_graph_line_strip()
317 gr->vertices + gr->index*2, in hud_draw_graph_line_strip()
318 gr->num_vertices - gr->index, in hud_draw_graph_line_strip()
319 gr->color[0], gr->color[1], gr->color[2], 1, in hud_draw_graph_line_strip()
320 xoffset - gr->index*2 - 1, yoffset, yscale); in hud_draw_graph_line_strip()
327 struct hud_graph *gr; in hud_pane_accumulate_vertices() local
352 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_pane_accumulate_vertices()
356 number_to_human_readable(gr->current_value, pane->type, str); in hud_pane_accumulate_vertices()
357 hud_draw_string(hud, x, y, " %s: %s", gr->name, str); in hud_pane_accumulate_vertices()
402 struct hud_graph *gr; in hud_pane_accumulate_vertices_simple() local
408 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_pane_accumulate_vertices_simple()
412 number_to_human_readable(gr->current_value, pane->type, str); in hud_pane_accumulate_vertices_simple()
413 hud_draw_string(hud, x, y, "%s: %s", gr->name, str); in hud_pane_accumulate_vertices_simple()
422 struct hud_graph *gr; in hud_pane_draw_colored_objects() local
427 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_pane_draw_colored_objects()
432 gr->color[0], gr->color[1], gr->color[2], 1); in hud_pane_draw_colored_objects()
437 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_pane_draw_colored_objects()
438 hud_draw_graph_line_strip(hud, gr, pane->inner_x1, pane->inner_y2, pane->yscale); in hud_pane_draw_colored_objects()
621 struct hud_graph *gr; in hud_start_queries() local
627 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_start_queries()
628 if (gr->begin_query) in hud_start_queries()
629 gr->begin_query(gr, pipe); in hud_start_queries()
639 struct hud_graph *gr, *next; in hud_stop_queries() local
675 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_stop_queries()
676 gr->query_new_value(gr, pipe); in hud_stop_queries()
680 LIST_FOR_EACH_ENTRY_SAFE(gr, next, &pane->graph_list, head) { in hud_stop_queries()
682 if (&gr->head == pane->graph_list.prev) in hud_stop_queries()
688 if (gr->current_value < in hud_stop_queries()
690 list_del(&gr->head); in hud_stop_queries()
691 list_add(&gr->head, &next->head); in hud_stop_queries()
835 hud_pane_update_dyn_ceiling(struct hud_graph *gr, struct hud_pane *pane) in hud_pane_update_dyn_ceiling() argument
840 if (pane->dyn_ceil_last_ran != gr->index) { in hud_pane_update_dyn_ceiling()
841 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_pane_update_dyn_ceiling()
842 for (i = 0; i < gr->num_vertices; ++i) { in hud_pane_update_dyn_ceiling()
843 tmp = gr->vertices[i * 2 + 1] > tmp ? in hud_pane_update_dyn_ceiling()
844 gr->vertices[i * 2 + 1] : tmp; in hud_pane_update_dyn_ceiling()
857 pane->dyn_ceil_last_ran = gr->index; in hud_pane_update_dyn_ceiling()
912 hud_pane_add_graph(struct hud_pane *pane, struct hud_graph *gr) in hud_pane_add_graph() argument
933 strip_hyphens(gr->name); in hud_pane_add_graph()
935 gr->vertices = MALLOC(pane->max_num_vertices * sizeof(float) * 2); in hud_pane_add_graph()
936 gr->color[0] = colors[color][0]; in hud_pane_add_graph()
937 gr->color[1] = colors[color][1]; in hud_pane_add_graph()
938 gr->color[2] = colors[color][2]; in hud_pane_add_graph()
939 gr->pane = pane; in hud_pane_add_graph()
940 list_addtail(&gr->head, &pane->graph_list); in hud_pane_add_graph()
946 hud_graph_add_value(struct hud_graph *gr, double value) in hud_graph_add_value() argument
948 gr->current_value = value; in hud_graph_add_value()
949 value = value > gr->pane->ceiling ? gr->pane->ceiling : value; in hud_graph_add_value()
951 if (gr->fd) { in hud_graph_add_value()
953 fprintf(gr->fd, "%f\n", value); in hud_graph_add_value()
956 fprintf(gr->fd, "%" PRIu64 "\n", (uint64_t) lround(value)); in hud_graph_add_value()
960 if (gr->index == gr->pane->max_num_vertices) { in hud_graph_add_value()
961 gr->vertices[0] = 0; in hud_graph_add_value()
962 gr->vertices[1] = gr->vertices[(gr->index-1)*2+1]; in hud_graph_add_value()
963 gr->index = 1; in hud_graph_add_value()
965 gr->vertices[(gr->index)*2+0] = (float) (gr->index * 2); in hud_graph_add_value()
966 gr->vertices[(gr->index)*2+1] = (float) value; in hud_graph_add_value()
967 gr->index++; in hud_graph_add_value()
969 if (gr->num_vertices < gr->pane->max_num_vertices) { in hud_graph_add_value()
970 gr->num_vertices++; in hud_graph_add_value()
973 if (gr->pane->dyn_ceiling == true) { in hud_graph_add_value()
974 hud_pane_update_dyn_ceiling(gr, gr->pane); in hud_graph_add_value()
976 if (value > gr->pane->max_value) { in hud_graph_add_value()
977 hud_pane_set_max_value(gr->pane, value); in hud_graph_add_value()
1030 hud_graph_set_dump_file(struct hud_graph *gr) in hud_graph_set_dump_file() argument
1036 + sizeof(gr->name)); in hud_graph_set_dump_file()
1040 strcat_without_spaces(dump_file, gr->name); in hud_graph_set_dump_file()
1041 gr->fd = fopen(dump_file, "w+"); in hud_graph_set_dump_file()
1042 if (gr->fd) { in hud_graph_set_dump_file()
1044 setvbuf(gr->fd, NULL, _IOLBF, 0); in hud_graph_set_dump_file()
1496 struct hud_graph *gr; in hud_parse_env_var() local
1498 LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { in hud_parse_env_var()
1499 hud_graph_set_dump_file(gr); in hud_parse_env_var()