![Noralf Trønnes](/assets/img/avatar_default.png)
The CMA helper is already using the drm_fb_helper_generic_probe part of the generic fbdev emulation. This patch makes full use of the generic fbdev emulation by using its drm_client callbacks. This means that drm_mode_config_funcs->output_poll_changed and drm_driver->lastclose are now handled by the emulation code. Additionally fbdev unregister happens automatically on drm_dev_unregister(). The drm_fbdev_generic_setup() call is put after drm_dev_register() in the driver. This is done to highlight the fact that fbdev emulation is an internal client that makes use of the driver, it is not part of the driver as such. If fbdev setup fails, an error is printed, but the driver succeeds probing. Cc: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Acked-by: Alexey Brodkin <abrodkin@synopsys.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181025201340.34227-2-noralf@tronnes.org
47 lines
1.3 KiB
C
47 lines
1.3 KiB
C
/*
|
|
* ARC PGU DRM driver.
|
|
*
|
|
* Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
*/
|
|
|
|
#ifndef _ARCPGU_H_
|
|
#define _ARCPGU_H_
|
|
|
|
struct arcpgu_drm_private {
|
|
void __iomem *regs;
|
|
struct clk *clk;
|
|
struct drm_framebuffer *fb;
|
|
struct drm_crtc crtc;
|
|
struct drm_plane *plane;
|
|
};
|
|
|
|
#define crtc_to_arcpgu_priv(x) container_of(x, struct arcpgu_drm_private, crtc)
|
|
|
|
static inline void arc_pgu_write(struct arcpgu_drm_private *arcpgu,
|
|
unsigned int reg, u32 value)
|
|
{
|
|
iowrite32(value, arcpgu->regs + reg);
|
|
}
|
|
|
|
static inline u32 arc_pgu_read(struct arcpgu_drm_private *arcpgu,
|
|
unsigned int reg)
|
|
{
|
|
return ioread32(arcpgu->regs + reg);
|
|
}
|
|
|
|
int arc_pgu_setup_crtc(struct drm_device *dev);
|
|
int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np);
|
|
int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np);
|
|
|
|
#endif
|