[PATCH 3/3] drm: Add a client-cap to set scheduling mode

Hillf Danton hdanton at sina.com
Sun Sep 20 02:17:11 UTC 2020


On Sat, 19 Sep 2020 12:37:26 -0700 Rob Clark wrote:
> +/**
> + * drm_crtc_set_sched_mode:
> + * @dev: DRM device
> + * @mode: one of DRM_CLIENT_CAP_SCHED_x
> + *
> + * Set the scheduling mode for per-CRTC kthread workers.  This controls
> + * whether nonblocking atomic commits will run with SCHED_NORMAL or
> + * SCHED_FIFO (rt) priority.
> + */
> +void drm_crtc_set_sched_mode(struct drm_device *dev, int mode)
> +{
> +	struct drm_crtc *crtc;
> +
> +	drm_for_each_crtc(crtc, dev) {
> +		switch (mode) {
> +		case DRM_CLIENT_CAP_SCHED_NORMAL:
> +			/* zero is default nice value for kthreads: */
> +			sched_set_normal(crtc->worker->task, 0);
> +			break;
> +		case DRM_CLIENT_CAP_SCHED_FIFO:
> +			sched_set_fifo(crtc->worker->task);
> +			break;

Better if they are done in kernel/kthread.c wrt FIFO worker.

Off-topic: if that's fine, what's preventing you from doing the same
in kernel/workqueue.c for the workqueus you create manually?



More information about the dri-devel mailing list