mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Restore old ugly inconsistent display of ADL information before the standard info
This commit is contained in:
parent
52b6410fe7
commit
3cb7221878
27
main.c
27
main.c
@ -2034,6 +2034,8 @@ static void tailsprintf(char *f, const char *fmt, ...)
|
|||||||
static void get_statline(char *buf, struct cgpu_info *cgpu)
|
static void get_statline(char *buf, struct cgpu_info *cgpu)
|
||||||
{
|
{
|
||||||
sprintf(buf, "%s%d ", cgpu->api->name, cgpu->device_id);
|
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",
|
tailsprintf(buf, "(%ds):%.1f (avg):%.1f Mh/s | A:%d R:%d HW:%d U:%.2f/m",
|
||||||
opt_log_interval,
|
opt_log_interval,
|
||||||
cgpu->rolling,
|
cgpu->rolling,
|
||||||
@ -2107,6 +2109,11 @@ static void curses_print_devstatus(int thr_id)
|
|||||||
cgpu->utility = cgpu->accepted / ( total_secs ? total_secs : 1 ) * 60;
|
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);
|
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)
|
if (cgpu->status == LIFE_DEAD)
|
||||||
wprintw(statuswin, "DEAD ");
|
wprintw(statuswin, "DEAD ");
|
||||||
else if (cgpu->status == LIFE_SICK)
|
else if (cgpu->status == LIFE_SICK)
|
||||||
@ -5556,10 +5563,9 @@ static void reinit_opencl_device(struct cgpu_info *gpu)
|
|||||||
tq_push(thr_info[gpur_thr_id].q, 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
|
#ifdef HAVE_ADL
|
||||||
|
static void get_opencl_statline_before(char *buf, struct cgpu_info *gpu)
|
||||||
|
{
|
||||||
if (gpu->has_adl) {
|
if (gpu->has_adl) {
|
||||||
int gpuid = gpu->device_id;
|
int gpuid = gpu->device_id;
|
||||||
float gt = gpu_temp(gpuid);
|
float gt = gpu_temp(gpuid);
|
||||||
@ -5571,11 +5577,19 @@ static void get_opencl_statline(char *buf, struct cgpu_info *gpu)
|
|||||||
else
|
else
|
||||||
tailsprintf(buf, " ", gt);
|
tailsprintf(buf, " ", gt);
|
||||||
if (gf != -1)
|
if (gf != -1)
|
||||||
tailsprintf(buf, " %4dRPM", gf);
|
tailsprintf(buf, "%4dRPM ", gf);
|
||||||
else if ((gp = gpu_fanpercent(gpuid)) != -1)
|
else if ((gp = gpu_fanpercent(gpuid)) != -1)
|
||||||
tailsprintf(buf, " %3d%%", gp);
|
tailsprintf(buf, "%3d%% ", gp);
|
||||||
|
else
|
||||||
|
tailsprintf(buf, " ");
|
||||||
|
tailsprintf(buf, "| ");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void get_opencl_statline(char *buf, struct cgpu_info *gpu)
|
||||||
|
{
|
||||||
|
tailsprintf(buf, " I:%2d", gpu->intensity);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct opencl_thread_data {
|
struct opencl_thread_data {
|
||||||
@ -5803,6 +5817,9 @@ struct device_api opencl_api = {
|
|||||||
.name = "GPU",
|
.name = "GPU",
|
||||||
.api_detect = opencl_detect,
|
.api_detect = opencl_detect,
|
||||||
.reinit_device = reinit_opencl_device,
|
.reinit_device = reinit_opencl_device,
|
||||||
|
#ifdef HAVE_ADL
|
||||||
|
.get_statline_before = get_opencl_statline_before,
|
||||||
|
#endif
|
||||||
.get_statline = get_opencl_statline,
|
.get_statline = get_opencl_statline,
|
||||||
.thread_prepare = opencl_thread_prepare,
|
.thread_prepare = opencl_thread_prepare,
|
||||||
.thread_init = opencl_thread_init,
|
.thread_init = opencl_thread_init,
|
||||||
|
1
miner.h
1
miner.h
@ -220,6 +220,7 @@ struct device_api {
|
|||||||
|
|
||||||
// Device-specific functions
|
// Device-specific functions
|
||||||
void (*reinit_device)(struct cgpu_info*);
|
void (*reinit_device)(struct cgpu_info*);
|
||||||
|
void (*get_statline_before)(char*, struct cgpu_info*);
|
||||||
void (*get_statline)(char*, struct cgpu_info*);
|
void (*get_statline)(char*, struct cgpu_info*);
|
||||||
|
|
||||||
// Thread-specific functions
|
// Thread-specific functions
|
||||||
|
Loading…
Reference in New Issue
Block a user