#include "vigs_comm.h"
#include "vigs_fbdev.h"
#include "drm_crtc_helper.h"
+#include "drm_plane_helper.h"
#include <linux/console.h>
static int vigs_crtc_update(struct drm_crtc *crtc,
* root surface has been updated.
*/
- if (!crtc->fb) {
- DRM_ERROR("crtc->fb is NULL\n");
+ if (!crtc->primary->fb) {
+ DRM_ERROR("crtc->primary->fb is NULL\n");
return -EINVAL;
}
vigs_old_fb = fb_to_vigs_fb(old_fb);
}
- vigs_fb = fb_to_vigs_fb(crtc->fb);
+ vigs_fb = fb_to_vigs_fb(crtc->primary->fb);
if (vigs_fb->surfaces[0]->scanout) {
retry:
{
unsigned long flags;
struct vigs_device *vigs_dev = crtc->dev->dev_private;
- struct drm_framebuffer *old_fb = crtc->fb;
+ struct drm_framebuffer *old_fb = crtc->primary->fb;
int ret = -EINVAL;
mutex_lock(&vigs_dev->drm_dev->struct_mutex);
&vigs_dev->pageflip_event_list);
spin_unlock_irqrestore(&vigs_dev->drm_dev->event_lock, flags);
- crtc->fb = fb;
+ crtc->primary->fb = fb;
ret = vigs_crtc_update(crtc, old_fb);
if (ret != 0) {
- crtc->fb = old_fb;
+ crtc->primary->fb = old_fb;
spin_lock_irqsave(&vigs_dev->drm_dev->event_lock, flags);
if (atomic_read(&vigs_dev->drm_dev->vblank[0].refcount) > 0) {
/*
DRM_DEBUG_KMS("enter\n");
- if (!crtc->fb) {
+ if (!crtc->primary->fb) {
/*
* No current framebuffer, no need to notify the host.
*/
return;
}
- vigs_fb = fb_to_vigs_fb(crtc->fb);
+ vigs_fb = fb_to_vigs_fb(crtc->primary->fb);
vigs_comm_set_root_surface(vigs_dev->comm, 0, 0, 0);
int bound = 0, crtcs_bound = 0;
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
- if (crtc->fb) {
+ if (crtc->primary->fb) {
crtcs_bound++;
}
- if (crtc->fb == fb_helper->fb) {
+ if (crtc->primary->fb == fb_helper->fb) {
bound++;
}
}
(*vigs_fbdev)->base.funcs = &vigs_fbdev_funcs;
+ drm_fb_helper_prepare(vigs_dev->drm_dev, &(*vigs_fbdev)->base,
+ &vigs_fbdev_funcs);
+
ret = drm_fb_helper_init(vigs_dev->drm_dev,
&(*vigs_fbdev)->base,
1, 1);
{
DRM_DEBUG_KMS("enter\n");
- drm_modeset_lock_all(vigs_fbdev->base.dev);
- drm_fb_helper_restore_fbdev_mode(&vigs_fbdev->base);
- drm_modeset_unlock_all(vigs_fbdev->base.dev);
+ drm_fb_helper_restore_fbdev_mode_unlocked(&vigs_fbdev->base);
}
DRM_DEBUG_KMS("enter\n");
- if (fb_get_options(drm_get_connector_name(connector), &option) == 0) {
+ if (fb_get_options(connector->name, &option) == 0) {
struct drm_cmdline_mode cmdline_mode;
if (drm_mode_parse_command_line_for_connector(option,