Merge pull request #75 from luke-jr/ugly_display Restore old ugly inconsistent display of ADL information before the standard info
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
diff --git a/main.c b/main.c
index fc1c2c3..51cfdb3 100644
--- a/main.c
+++ b/main.c
@@ -2041,6 +2041,8 @@ static void tailsprintf(char *f, const char *fmt, ...)
static void get_statline(char *buf, struct cgpu_info *cgpu)
{
sprintf(buf, "%s%d ", cgpu->api->name, cgpu->device_id);
+ if (cgpu->api->get_statline_before)
+ cgpu->api->get_statline_before(buf, cgpu);
tailsprintf(buf, "(%ds):%.1f (avg):%.1f Mh/s | A:%d R:%d HW:%d U:%.2f/m",
opt_log_interval,
cgpu->rolling,
@@ -2114,6 +2116,11 @@ static void curses_print_devstatus(int thr_id)
cgpu->utility = cgpu->accepted / ( total_secs ? total_secs : 1 ) * 60;
mvwprintw(statuswin, devcursor + cgpu->cgminer_id, 0, " %s %d: ", cgpu->api->name, cgpu->device_id);
+ if (cgpu->api->get_statline_before) {
+ logline[0] = '\0';
+ cgpu->api->get_statline_before(logline, cgpu);
+ wprintw(statuswin, "%s", logline);
+ }
if (cgpu->status == LIFE_DEAD)
wprintw(statuswin, "DEAD ");
else if (cgpu->status == LIFE_SICK)
@@ -5563,10 +5570,9 @@ static void reinit_opencl_device(struct cgpu_info *gpu)
tq_push(thr_info[gpur_thr_id].q, gpu);
}
-static void get_opencl_statline(char *buf, struct cgpu_info *gpu)
-{
- tailsprintf(buf, " | I:%2d", gpu->intensity);
#ifdef HAVE_ADL
+static void get_opencl_statline_before(char *buf, struct cgpu_info *gpu)
+{
if (gpu->has_adl) {
int gpuid = gpu->device_id;
float gt = gpu_temp(gpuid);
@@ -5578,11 +5584,19 @@ static void get_opencl_statline(char *buf, struct cgpu_info *gpu)
else
tailsprintf(buf, " ", gt);
if (gf != -1)
- tailsprintf(buf, " %4dRPM", gf);
+ tailsprintf(buf, "%4dRPM ", gf);
else if ((gp = gpu_fanpercent(gpuid)) != -1)
- tailsprintf(buf, " %3d%%", gp);
+ tailsprintf(buf, "%3d%% ", gp);
+ else
+ tailsprintf(buf, " ");
+ tailsprintf(buf, "| ");
}
+}
#endif
+
+static void get_opencl_statline(char *buf, struct cgpu_info *gpu)
+{
+ tailsprintf(buf, " I:%2d", gpu->intensity);
}
struct opencl_thread_data {
@@ -5810,6 +5824,9 @@ struct device_api opencl_api = {
.name = "GPU",
.api_detect = opencl_detect,
.reinit_device = reinit_opencl_device,
+#ifdef HAVE_ADL
+ .get_statline_before = get_opencl_statline_before,
+#endif
.get_statline = get_opencl_statline,
.thread_prepare = opencl_thread_prepare,
.thread_init = opencl_thread_init,
diff --git a/miner.h b/miner.h
index eb29058..79f7ac1 100644
--- a/miner.h
+++ b/miner.h
@@ -220,6 +220,7 @@ struct device_api {
// Device-specific functions
void (*reinit_device)(struct cgpu_info*);
+ void (*get_statline_before)(char*, struct cgpu_info*);
void (*get_statline)(char*, struct cgpu_info*);
// Thread-specific functions