forked from Minki/linux
drm/nouveau: Convert to CRTC VBLANK callbacks
VBLANK callbacks in struct drm_driver are deprecated in favor of their equivalents in struct drm_crtc_funcs. Convert nouvean over. v4: * add argument names in function declaration Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200123135943.24140-10-tzimmermann@suse.de
This commit is contained in:
parent
072a26c75c
commit
91640a71e7
@ -1248,6 +1248,9 @@ static const struct drm_crtc_funcs nv04_crtc_funcs = {
|
|||||||
.set_config = drm_crtc_helper_set_config,
|
.set_config = drm_crtc_helper_set_config,
|
||||||
.page_flip = nv04_crtc_page_flip,
|
.page_flip = nv04_crtc_page_flip,
|
||||||
.destroy = nv_crtc_destroy,
|
.destroy = nv_crtc_destroy,
|
||||||
|
.enable_vblank = nouveau_display_vblank_enable,
|
||||||
|
.disable_vblank = nouveau_display_vblank_disable,
|
||||||
|
.get_vblank_timestamp = drm_crtc_vblank_helper_get_vblank_timestamp,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct drm_crtc_helper_funcs nv04_crtc_helper_funcs = {
|
static const struct drm_crtc_helper_funcs nv04_crtc_helper_funcs = {
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_crtc_helper.h>
|
#include <drm/drm_crtc_helper.h>
|
||||||
|
#include <drm/drm_vblank.h>
|
||||||
#include "nouveau_connector.h"
|
#include "nouveau_connector.h"
|
||||||
void
|
void
|
||||||
nv50_head_flush_clr(struct nv50_head *head,
|
nv50_head_flush_clr(struct nv50_head *head,
|
||||||
@ -472,6 +473,9 @@ nv50_head_func = {
|
|||||||
.page_flip = drm_atomic_helper_page_flip,
|
.page_flip = drm_atomic_helper_page_flip,
|
||||||
.atomic_duplicate_state = nv50_head_atomic_duplicate_state,
|
.atomic_duplicate_state = nv50_head_atomic_duplicate_state,
|
||||||
.atomic_destroy_state = nv50_head_atomic_destroy_state,
|
.atomic_destroy_state = nv50_head_atomic_destroy_state,
|
||||||
|
.enable_vblank = nouveau_display_vblank_enable,
|
||||||
|
.disable_vblank = nouveau_display_vblank_disable,
|
||||||
|
.get_vblank_timestamp = drm_crtc_vblank_helper_get_vblank_timestamp,
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -54,15 +54,10 @@ nouveau_display_vblank_handler(struct nvif_notify *notify)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nouveau_display_vblank_enable(struct drm_device *dev, unsigned int pipe)
|
nouveau_display_vblank_enable(struct drm_crtc *crtc)
|
||||||
{
|
{
|
||||||
struct drm_crtc *crtc;
|
|
||||||
struct nouveau_crtc *nv_crtc;
|
struct nouveau_crtc *nv_crtc;
|
||||||
|
|
||||||
crtc = drm_crtc_from_index(dev, pipe);
|
|
||||||
if (!crtc)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
nv_crtc = nouveau_crtc(crtc);
|
nv_crtc = nouveau_crtc(crtc);
|
||||||
nvif_notify_get(&nv_crtc->vblank);
|
nvif_notify_get(&nv_crtc->vblank);
|
||||||
|
|
||||||
@ -70,15 +65,10 @@ nouveau_display_vblank_enable(struct drm_device *dev, unsigned int pipe)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nouveau_display_vblank_disable(struct drm_device *dev, unsigned int pipe)
|
nouveau_display_vblank_disable(struct drm_crtc *crtc)
|
||||||
{
|
{
|
||||||
struct drm_crtc *crtc;
|
|
||||||
struct nouveau_crtc *nv_crtc;
|
struct nouveau_crtc *nv_crtc;
|
||||||
|
|
||||||
crtc = drm_crtc_from_index(dev, pipe);
|
|
||||||
if (!crtc)
|
|
||||||
return;
|
|
||||||
|
|
||||||
nv_crtc = nouveau_crtc(crtc);
|
nv_crtc = nouveau_crtc(crtc);
|
||||||
nvif_notify_put(&nv_crtc->vblank);
|
nvif_notify_put(&nv_crtc->vblank);
|
||||||
}
|
}
|
||||||
|
@ -61,8 +61,8 @@ int nouveau_display_init(struct drm_device *dev, bool resume, bool runtime);
|
|||||||
void nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime);
|
void nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime);
|
||||||
int nouveau_display_suspend(struct drm_device *dev, bool runtime);
|
int nouveau_display_suspend(struct drm_device *dev, bool runtime);
|
||||||
void nouveau_display_resume(struct drm_device *dev, bool runtime);
|
void nouveau_display_resume(struct drm_device *dev, bool runtime);
|
||||||
int nouveau_display_vblank_enable(struct drm_device *, unsigned int);
|
int nouveau_display_vblank_enable(struct drm_crtc *crtc);
|
||||||
void nouveau_display_vblank_disable(struct drm_device *, unsigned int);
|
void nouveau_display_vblank_disable(struct drm_crtc *crtc);
|
||||||
bool nouveau_display_scanoutpos(struct drm_crtc *crtc,
|
bool nouveau_display_scanoutpos(struct drm_crtc *crtc,
|
||||||
bool in_vblank_irq, int *vpos, int *hpos,
|
bool in_vblank_irq, int *vpos, int *hpos,
|
||||||
ktime_t *stime, ktime_t *etime,
|
ktime_t *stime, ktime_t *etime,
|
||||||
|
@ -1121,10 +1121,6 @@ driver_stub = {
|
|||||||
.debugfs_init = nouveau_drm_debugfs_init,
|
.debugfs_init = nouveau_drm_debugfs_init,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
.enable_vblank = nouveau_display_vblank_enable,
|
|
||||||
.disable_vblank = nouveau_display_vblank_disable,
|
|
||||||
.get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos,
|
|
||||||
|
|
||||||
.ioctls = nouveau_ioctls,
|
.ioctls = nouveau_ioctls,
|
||||||
.num_ioctls = ARRAY_SIZE(nouveau_ioctls),
|
.num_ioctls = ARRAY_SIZE(nouveau_ioctls),
|
||||||
.fops = &nouveau_driver_fops,
|
.fops = &nouveau_driver_fops,
|
||||||
|
Loading…
Reference in New Issue
Block a user