[PATCH v2] Disable CRTCs when disabling the outputs
Michel Dänzer
michel at daenzer.net
Tue Jun 23 19:33:00 PDT 2015
On 24.06.2015 04:38, Piotr Redlewski wrote:
> When turning the outputs off (DPMSModeOff), CRTCs stayed enabled. This led
> to higher gpu temperatures than with fglrx driver.
>
> v2: when entering DPMS also disable active CRTCs
>
> Signed-off-by: Piotr Redlewski <predlewski at gmail.com>
[...]
> + output_ids = calloc(sizeof(uint32_t), xf86_config->num_output);
> + if (!output_ids)
> + return;
> +
> + for (i = 0; i < xf86_config->num_output; i++) {
> + xf86OutputPtr output = xf86_config->output[i];
> + drmmode_output_private_ptr drmmode_output;
> +
> + if (output->crtc != crtc)
> + continue;
> +
> + drmmode_output = output->driver_private;
> + output_ids[output_count]
> + = drmmode_output->mode_output->connector_id;
> + output_count++;
> + }
> +
> + drmmode_ConvertToKMode(crtc->scrn, &kmode, &crtc->mode);
> +
> + drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
> + drmmode->fb_id, crtc->x, crtc->y, output_ids,
> + output_count, &kmode);
> +
> + free(output_ids);
This could be simplified to:
crtc->funcs->set_mode_major(crtc, &crtc->mode, crtc->rotation, crtc->x,
crtc->y);
One side effect of that is it calls drmmode_output_dpms() to enable the
outputs associated with the CRTC, but I think the X server would do
that anyway after enabling the CRTC. What do you think?
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the xorg-driver-ati
mailing list