[PATCH 12/13] drm/amdgpu: Define one variable for virtual display.
Alex Deucher
alexdeucher at gmail.com
Thu Aug 4 18:22:11 UTC 2016
On Wed, Aug 3, 2016 at 11:42 PM, Emily Deng <Emily.Deng at amd.com> wrote:
> For virtual display feature, define on variable in amdgpu.ko. When want to
> enable virtual display feature, need set the option "amdgpu.virtual_display=1".
> And then disable vga render and crtc if have DCE engine.
>
> Signed-off-by: Emily Deng <Emily.Deng at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
> 3 files changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 7a9e6b8..1ebf634 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -93,6 +93,7 @@ extern unsigned amdgpu_pcie_lane_cap;
> extern unsigned amdgpu_cg_mask;
> extern unsigned amdgpu_pg_mask;
> extern int amdgpu_sclk_deep_sleep_en;
> +extern int amdgpu_virtual_display;
>
> #define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000
> #define AMDGPU_MAX_USEC_TIMEOUT 100000 /* 100 ms */
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index edbb370..2d7eb34 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1265,6 +1265,9 @@ static int amdgpu_init(struct amdgpu_device *adev)
> {
> int i, r;
>
> + if(amdgpu_virtual_display)
> + amdgpu_display_disable_vga_and_crtc(adev);
> +
You can drop this if you implement the changes I proposed in the patch
that adds this.
Alex
> for (i = 0; i < adev->num_ip_blocks; i++) {
> if (!adev->ip_block_status[i].valid)
> continue;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index f2af1ff..7007cf7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -90,6 +90,7 @@ unsigned amdgpu_pcie_gen_cap = 0;
> unsigned amdgpu_pcie_lane_cap = 0;
> unsigned amdgpu_cg_mask = 0xffffffff;
> unsigned amdgpu_pg_mask = 0xffffffff;
> +int amdgpu_virtual_display = 0;
>
> MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
> module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
> @@ -189,6 +190,9 @@ module_param_named(cg_mask, amdgpu_cg_mask, uint, 0444);
> MODULE_PARM_DESC(pg_mask, "Powergating flags mask (0 = disable power gating)");
> module_param_named(pg_mask, amdgpu_pg_mask, uint, 0444);
>
> +MODULE_PARM_DESC(virtual_display, "enable virtual display (0 = disable virtual display)");
> +module_param_named(virtual_display, amdgpu_virtual_display, int, 0444);
> +
> static const struct pci_device_id pciidlist[] = {
> #ifdef CONFIG_DRM_AMDGPU_CIK
> /* Kaveri */
> --
> 1.9.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list