struct g2d_context *ctx = container_of(work, struct g2d_context,
dwork.work);
- g2d_put_performance(ctx);
+ g2d_put_performance(ctx, false);
}
static int g2d_open(struct inode *inode, struct file *filp)
kfree(g2d_ctx->hwfc_info);
}
- g2d_put_performance(g2d_ctx);
+ g2d_put_performance(g2d_ctx, true);
kfree(g2d_ctx);
ret = -EFAULT;
break;
}
- g2d_set_performance(ctx, &data);
+ g2d_set_performance(ctx, &data, false);
break;
}
}
void g2d_set_performance(struct g2d_context *ctx,
- struct g2d_performance_data *data)
+ struct g2d_performance_data *data, bool release)
{
struct g2d_device *g2d_dev = ctx->g2d_dev;
int i;
mutex_lock(&g2d_dev->lock_qos);
if (!data->num_frame) {
- if (g2d_still_need_perf(g2d_dev)) {
+ if (g2d_still_need_perf(g2d_dev) && !release) {
mutex_unlock(&g2d_dev->lock_qos);
return;
}
mutex_unlock(&g2d_dev->lock_qos);
}
-void g2d_put_performance(struct g2d_context *ctx)
+void g2d_put_performance(struct g2d_context *ctx, bool release)
{
struct g2d_performance_data data;
data.num_frame = 0;
- g2d_set_performance(ctx, &data);
+ g2d_set_performance(ctx, &data, release);
}
#define BTS_PEAK_FPS_RATIO 1667
void g2d_set_performance(struct g2d_context *ctx,
- struct g2d_performance_data *data);
-void g2d_put_performance(struct g2d_context *ctx);
+ struct g2d_performance_data *data, bool release);
+void g2d_put_performance(struct g2d_context *ctx, bool release);
#endif /* _G2D_PERF_H_ */