DRM deinit with error device
Hello team!
For multi-GPU hotplug, when one connector on a special card is disconnected, it will be detached from head. The following code should be called:
static void
drm_output_deinit(struct weston_output *base)
{
struct drm_output *output = to_drm_output(base);
struct drm_backend *b = output->backend;
struct drm_device *device = b->drm;
struct drm_pending_state *pending;
if (!b->compositor->shutting_down) {
pending = drm_pending_state_alloc(device);
drm_output_get_disable_state(pending, output);
drm_pending_state_apply_sync(pending);
}
if (b->compositor->renderer->type == WESTON_RENDERER_PIXMAN)
drm_output_fini_pixman(output);
else
drm_output_fini_egl(output);
drm_output_deinit_planes(output);
drm_output_detach_crtc(output);
if (output->hdr_output_metadata_blob_id) {
drmModeDestroyPropertyBlob(device->drm.fd,
output->hdr_output_metadata_blob_id);
output->hdr_output_metadata_blob_id = 0;
}
}
I think the struct drm_device *device = b->drm;
is assigned as an error device, because the disconnected connector may
be belonged to a additional device, so always assign the b->drm
to drm_device is a wrong code.
I think it should be change with:
struct drm_device *device = output->device;
Is this right?
Snow Best regards
Edited by zhou liang