@@ -113,6 +113,7 @@ struct intel_fbdev {
struct intel_framebuffer ifb;
struct list_head fbdev_list;
struct drm_display_mode *our_mode;
+ bool first_bind_done;
};
struct intel_encoder {
@@ -43,6 +43,27 @@
#include <drm/i915_drm.h>
#include "i915_drv.h"
+static void intel_fb_bind(struct fb_info *info)
+{
+ struct drm_fb_helper *drm_helper = info->par;
+ struct drm_device *dev = drm_helper->dev;
+ struct intel_fbdev *ifbdev =
+ container_of(drm_helper, struct intel_fbdev, helper);
+
+ if (ifbdev->first_bind_done)
+ intel_display_power_put(dev, POWER_DOMAIN_VGA);
+ else
+ ifbdev->first_bind_done = true;
+}
+
+static void intel_fb_unbind(struct fb_info *info)
+{
+ struct drm_fb_helper *fb_helper = info->par;
+ struct drm_device *dev = fb_helper->dev;
+
+ intel_display_power_get(dev, POWER_DOMAIN_VGA);
+}
+
static struct fb_ops intelfb_ops = {
.owner = THIS_MODULE,
.fb_check_var = drm_fb_helper_check_var,
@@ -55,6 +76,8 @@ static struct fb_ops intelfb_ops = {
.fb_setcmap = drm_fb_helper_setcmap,
.fb_debug_enter = drm_fb_helper_debug_enter,
.fb_debug_leave = drm_fb_helper_debug_leave,
+ .fb_bind = intel_fb_bind,
+ .fb_unbind = intel_fb_unbind,
};
static int intelfb_create(struct drm_fb_helper *helper,