/* * Copyright 2023 Red Hat Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE.
*/ #include <subdev/instmem/priv.h> #include <subdev/gsp.h>
void
r535_fbsr_resume(struct nvkm_gsp *gsp)
{ /* RM has restored VRAM contents already, so just need to free the sysmem buffer. */
nvkm_gsp_sg_free(gsp->subdev.device, &gsp->sr.fbsr);
}
/* Create a list of all regions we need RM to save during suspend. */
list_for_each_entry(iobj, &imem->list, head) { if (iobj->preserve) { if (!fbsr_inst(&fbsr, "inst", &iobj->memory)) return -ENOMEM;
}
}
ret = nvkm_gsp_sg(gsp->subdev.device, fbsr.size, &gsp->sr.fbsr); if (ret) goto done;
/* Tell RM about the sysmem which will hold VRAM contents across suspend. */
ret = nvkm_gsp_client_device_ctor(gsp, &fbsr.client, &fbsr.device); if (ret) goto done_sgt;
ret = fbsr_init(&fbsr, &gsp->sr.fbsr, items_size); if (WARN_ON(ret)) goto done_sgt;
/* Send VRAM regions that need saving. */
list_for_each_entry(item, &fbsr.items, head) {
ret = fbsr_send(&fbsr, item); if (WARN_ON(ret)) goto done_sgt;
}
/* Cleanup everything except the sysmem backup, which will be removed after resume. */
done_sgt: if (ret) /* ... unless we failed already. */
nvkm_gsp_sg_free(device, &gsp->sr.fbsr);
done:
list_for_each_entry_safe(item, temp, &fbsr.items, head) {
list_del(&item->head);
kfree(item);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.