From: "Christian König" <christian.koenig@amd.com>
To: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>,
dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Cc: nicolai.haehnle@amd.com, michel@daenzer.net,
manasi.d.navare@intel.com, Alexander.Deucher@amd.com,
Marek.Olsak@amd.com
Subject: Re: [PATCH 6/9] drm/amdgpu: add freesync ioctl
Date: Tue, 11 Sep 2018 19:51:33 +0200 [thread overview]
Message-ID: <4a0073f9-1c80-e621-e959-d321f1cb36f4@amd.com> (raw)
In-Reply-To: <20180911161333.5334-7-nicholas.kazlauskas@amd.com>
Am 11.09.2018 um 18:13 schrieb Nicholas Kazlauskas:
> From: Harry Wentland <harry.wentland@amd.com>
>
> Add the ioctl to enable/disable freesync.
Why do we still need this now that we have the DRM CRTC properties?
Christian.
>
> Signed-off-by: Harry Wentland <harry.wentland@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 +++
> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 15 +++++++++++++++
> drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 3 ++-
> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++
> include/uapi/drm/amdgpu_drm.h | 16 ++++++++++++++++
> 5 files changed, 40 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 447c4c7a36d6..95af917007f7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1193,6 +1193,9 @@ int amdgpu_cs_wait_fences_ioctl(struct drm_device *dev, void *data,
> int amdgpu_gem_metadata_ioctl(struct drm_device *dev, void *data,
> struct drm_file *filp);
>
> +int amdgpu_display_freesync_ioctl(struct drm_device *dev, void *data,
> + struct drm_file *filp);
> +
> /* VRAM scratch page for HDP bug, default vram page */
> struct amdgpu_vram_scratch {
> struct amdgpu_bo *robj;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> index 642b47c5f4b8..7d6a36bca9dd 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> @@ -894,3 +894,18 @@ int amdgpu_display_crtc_idx_to_irq_type(struct amdgpu_device *adev, int crtc)
> return AMDGPU_CRTC_IRQ_NONE;
> }
> }
> +
> +int amdgpu_display_freesync_ioctl(struct drm_device *dev, void *data,
> + struct drm_file *filp)
> +{
> + int ret = -EPERM;
> + struct amdgpu_device *adev = dev->dev_private;
> +
> + if (adev->mode_info.funcs->notify_freesync)
> + ret = adev->mode_info.funcs->notify_freesync(dev,data,filp);
> + else
> + DRM_DEBUG("amdgpu no notify_freesync ioctl\n");
> +
> + return ret;
> +}
> +
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index bd98cc5fb97b..5b26e0447221 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -1099,7 +1099,8 @@ const struct drm_ioctl_desc amdgpu_ioctls_kms[] = {
> DRM_IOCTL_DEF_DRV(AMDGPU_GEM_METADATA, amdgpu_gem_metadata_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
> DRM_IOCTL_DEF_DRV(AMDGPU_GEM_VA, amdgpu_gem_va_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
> DRM_IOCTL_DEF_DRV(AMDGPU_GEM_OP, amdgpu_gem_op_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
> - DRM_IOCTL_DEF_DRV(AMDGPU_GEM_USERPTR, amdgpu_gem_userptr_ioctl, DRM_AUTH|DRM_RENDER_ALLOW)
> + DRM_IOCTL_DEF_DRV(AMDGPU_GEM_USERPTR, amdgpu_gem_userptr_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
> + DRM_IOCTL_DEF_DRV(AMDGPU_FREESYNC, amdgpu_display_freesync_ioctl, DRM_MASTER)
> };
> const int amdgpu_max_kms_ioctl = ARRAY_SIZE(amdgpu_ioctls_kms);
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 8be3028850b6..56598ed53123 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1584,6 +1584,7 @@ static void dm_bandwidth_update(struct amdgpu_device *adev)
> static int amdgpu_notify_freesync(struct drm_device *dev, void *data,
> struct drm_file *filp)
> {
> + struct drm_amdgpu_freesync *args = data;
> struct drm_atomic_state *state;
> struct drm_modeset_acquire_ctx ctx;
> struct drm_crtc *crtc;
> @@ -1593,6 +1594,9 @@ static int amdgpu_notify_freesync(struct drm_device *dev, void *data,
> uint8_t i;
> bool enable = false;
>
> + if (args->op == AMDGPU_FREESYNC_FULLSCREEN_ENTER)
> + enable = true;
> +
> drm_modeset_acquire_init(&ctx, 0);
>
> state = drm_atomic_state_alloc(dev);
> diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
> index 1ceec56de015..94444eeba55b 100644
> --- a/include/uapi/drm/amdgpu_drm.h
> +++ b/include/uapi/drm/amdgpu_drm.h
> @@ -54,6 +54,8 @@ extern "C" {
> #define DRM_AMDGPU_VM 0x13
> #define DRM_AMDGPU_FENCE_TO_HANDLE 0x14
> #define DRM_AMDGPU_SCHED 0x15
> +/* not upstream */
> +#define DRM_AMDGPU_FREESYNC 0x5d
>
> #define DRM_IOCTL_AMDGPU_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_CREATE, union drm_amdgpu_gem_create)
> #define DRM_IOCTL_AMDGPU_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_MMAP, union drm_amdgpu_gem_mmap)
> @@ -71,6 +73,7 @@ extern "C" {
> #define DRM_IOCTL_AMDGPU_VM DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_VM, union drm_amdgpu_vm)
> #define DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_FENCE_TO_HANDLE, union drm_amdgpu_fence_to_handle)
> #define DRM_IOCTL_AMDGPU_SCHED DRM_IOW(DRM_COMMAND_BASE + DRM_AMDGPU_SCHED, union drm_amdgpu_sched)
> +#define DRM_IOCTL_AMDGPU_FREESYNC DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_FREESYNC, struct drm_amdgpu_freesync)
>
> /**
> * DOC: memory domains
> @@ -987,6 +990,19 @@ struct drm_amdgpu_info_vce_clock_table {
> #define AMDGPU_FAMILY_AI 141 /* Vega10 */
> #define AMDGPU_FAMILY_RV 142 /* Raven */
>
> +/*
> + * Definition of free sync enter and exit signals
> + * We may have more options in the future
> + */
> +#define AMDGPU_FREESYNC_FULLSCREEN_ENTER 1
> +#define AMDGPU_FREESYNC_FULLSCREEN_EXIT 2
> +
> +struct drm_amdgpu_freesync {
> + __u32 op; /* AMDGPU_FREESYNC_FULLSCREEN_ENTER or */
> + /* AMDGPU_FREESYNC_FULLSCREEN_ENTER */
> + __u32 spare[7];
> +};
> +
> #if defined(__cplusplus)
> }
> #endif
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-09-11 17:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-11 16:13 [PATCH 0/9] A DRM API for adaptive sync and variable refresh rate support Nicholas Kazlauskas
[not found] ` <20180911161333.5334-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
2018-09-11 16:13 ` [PATCH 1/9] drm: Add variable refresh rate properties to DRM connector Nicholas Kazlauskas
2018-09-11 16:22 ` Ville Syrjälä
[not found] ` <20180911162243.GN5565-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-09-11 16:31 ` Ville Syrjälä
2018-09-11 17:36 ` Kazlauskas, Nicholas
[not found] ` <b7b0cff8-3d90-d3e1-0080-e422c1bcac83-5C7GfCeVMHo@public.gmane.org>
2018-09-11 17:56 ` Ville Syrjälä
[not found] ` <20180911175637.GP5565-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-09-11 18:16 ` Kazlauskas, Nicholas
2018-09-11 18:23 ` Harry Wentland
2018-09-11 18:09 ` Daniel Vetter
2018-09-11 17:18 ` Manasi Navare
2018-09-11 17:15 ` Manasi Navare
2018-09-11 16:13 ` [PATCH 2/9] drm: Add variable refresh property to DRM CRTC Nicholas Kazlauskas
2018-09-11 16:13 ` [PATCH 3/9] drm/amdgpu: fill in amdgpu_dm_remove_sink_from_freesync_module Nicholas Kazlauskas
2018-09-11 16:13 ` [PATCH 5/9] drm/amdgpu/display: add freesync drm properties Nicholas Kazlauskas
2018-09-11 16:13 ` [PATCH 6/9] drm/amdgpu: add freesync ioctl Nicholas Kazlauskas
2018-09-11 17:51 ` Christian König [this message]
2018-09-11 17:57 ` Kazlauskas, Nicholas
2018-09-11 19:17 ` Alex Deucher
[not found] ` <CADnq5_PrTj_HaV-gpD5y6B+p7O=R+WxxWA9ytAKBYMQUW-GE7w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-12 7:11 ` Christian König
2018-09-11 16:13 ` [PATCH 8/9] drm/amd/display: Drop FreeSync ioctl notification support Nicholas Kazlauskas
2018-09-11 16:13 ` [PATCH 4/9] drm/amd/display: Refactor FreeSync module Nicholas Kazlauskas
2018-09-11 16:13 ` [PATCH 7/9] drm/amd/display: Replace FreeSync props with DRM VRR props Nicholas Kazlauskas
2018-09-11 16:13 ` [PATCH 9/9] drm/amdgpu: Drop unneeded freesync properties from amdpgu Nicholas Kazlauskas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4a0073f9-1c80-e621-e959-d321f1cb36f4@amd.com \
--to=christian.koenig@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Marek.Olsak@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=manasi.d.navare@intel.com \
--cc=michel@daenzer.net \
--cc=nicholas.kazlauskas@amd.com \
--cc=nicolai.haehnle@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox