[Openchrome-devel] drm-openchrome: Branch 'drm-next-3.19' - 5 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Tue Aug 22 20:09:05 UTC 2017
drivers/gpu/drm/openchrome/via_display.c | 14 ++-
drivers/gpu/drm/openchrome/via_fb.c | 115 +++++++++++++++----------------
2 files changed, 66 insertions(+), 63 deletions(-)
New commits:
commit cc7124bc65aa04bb03338d8ff11c54e81da8650e
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue Aug 22 12:41:41 2017 -0700
Rename viafb_ops to via_fb_ops
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/via_fb.c b/drivers/gpu/drm/openchrome/via_fb.c
index 80d6d72ba93a..49de88037ae5 100644
--- a/drivers/gpu/drm/openchrome/via_fb.c
+++ b/drivers/gpu/drm/openchrome/via_fb.c
@@ -1029,6 +1029,20 @@ int drmfb_helper_pan_display(struct fb_var_screeninfo *var,
return ret;
}
+static struct fb_ops via_fb_ops = {
+ .owner = THIS_MODULE,
+ .fb_check_var = drm_fb_helper_check_var,
+ .fb_set_par = drm_fb_helper_set_par,
+ .fb_fillrect = cfb_fillrect,
+ .fb_copyarea = cfb_copyarea,
+ .fb_imageblit = cfb_imageblit,
+ .fb_pan_display = drmfb_helper_pan_display,
+ .fb_blank = drm_fb_helper_blank,
+ .fb_setcmap = drm_fb_helper_setcmap,
+ .fb_debug_enter = drm_fb_helper_debug_enter,
+ .fb_debug_leave = drm_fb_helper_debug_leave,
+};
+
static int
via_fb_probe(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes)
@@ -1158,20 +1172,6 @@ static struct drm_fb_helper_funcs via_fb_helper_funcs = {
.fb_probe = via_fb_probe,
};
-static struct fb_ops viafb_ops = {
- .owner = THIS_MODULE,
- .fb_check_var = drm_fb_helper_check_var,
- .fb_set_par = drm_fb_helper_set_par,
- .fb_fillrect = cfb_fillrect,
- .fb_copyarea = cfb_copyarea,
- .fb_imageblit = cfb_imageblit,
- .fb_pan_display = drmfb_helper_pan_display,
- .fb_blank = drm_fb_helper_blank,
- .fb_setcmap = drm_fb_helper_setcmap,
- .fb_debug_enter = drm_fb_helper_debug_enter,
- .fb_debug_leave = drm_fb_helper_debug_leave,
-};
-
int
via_fbdev_init(struct drm_device *dev, struct drm_fb_helper **ptr)
{
@@ -1194,7 +1194,7 @@ via_fbdev_init(struct drm_device *dev, struct drm_fb_helper **ptr)
strcpy(info->fix.id, dev->driver->name);
strcat(info->fix.id, "drmfb");
info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT;
- info->fbops = &viafb_ops;
+ info->fbops = &via_fb_ops;
info->pixmap.size = 64*1024;
info->pixmap.buf_align = 8;
commit 6ea961502c12e21d80a8f0ddf446d79a94b24df2
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue Aug 22 12:39:17 2017 -0700
Move drmfb_helper_pan_display to another part of the file
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/via_fb.c b/drivers/gpu/drm/openchrome/via_fb.c
index 41b1bca0b44c..80d6d72ba93a 100644
--- a/drivers/gpu/drm/openchrome/via_fb.c
+++ b/drivers/gpu/drm/openchrome/via_fb.c
@@ -990,6 +990,45 @@ static const struct drm_mode_config_funcs via_mode_funcs = {
.output_poll_changed = via_output_poll_changed
};
+int drmfb_helper_pan_display(struct fb_var_screeninfo *var,
+ struct fb_info *info)
+{
+ struct drm_fb_helper *fb_helper = info->par;
+ struct drm_crtc_helper_funcs *crtc_funcs;
+ struct drm_device *dev = fb_helper->dev;
+ struct drm_mode_set *modeset;
+ struct drm_crtc *crtc;
+ int ret = -ENXIO, i;
+
+ mutex_lock(&dev->mode_config.mutex);
+ for (i = 0; i < fb_helper->crtc_count; i++) {
+ crtc = fb_helper->crtc_info[i].mode_set.crtc;
+ crtc_funcs = crtc->helper_private;
+
+ if (!crtc_funcs->mode_set_base)
+ continue;
+
+ modeset = &fb_helper->crtc_info[i].mode_set;
+ modeset->x = var->xoffset;
+ modeset->y = var->yoffset;
+
+ if (modeset->num_connectors) {
+ ret = crtc_funcs->mode_set_base(crtc, modeset->x,
+ modeset->y,
+ crtc->primary->fb);
+ if (!ret) {
+ info->flags |= FBINFO_HWACCEL_YPAN;
+ info->var.xoffset = var->xoffset;
+ info->var.yoffset = var->yoffset;
+ }
+ }
+ }
+ if (ret)
+ info->flags &= ~FBINFO_HWACCEL_YPAN;
+ mutex_unlock(&dev->mode_config.mutex);
+ return ret;
+}
+
static int
via_fb_probe(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes)
@@ -1119,46 +1158,6 @@ static struct drm_fb_helper_funcs via_fb_helper_funcs = {
.fb_probe = via_fb_probe,
};
-int
-drmfb_helper_pan_display(struct fb_var_screeninfo *var,
- struct fb_info *info)
-{
- struct drm_fb_helper *fb_helper = info->par;
- struct drm_crtc_helper_funcs *crtc_funcs;
- struct drm_device *dev = fb_helper->dev;
- struct drm_mode_set *modeset;
- struct drm_crtc *crtc;
- int ret = -ENXIO, i;
-
- mutex_lock(&dev->mode_config.mutex);
- for (i = 0; i < fb_helper->crtc_count; i++) {
- crtc = fb_helper->crtc_info[i].mode_set.crtc;
- crtc_funcs = crtc->helper_private;
-
- if (!crtc_funcs->mode_set_base)
- continue;
-
- modeset = &fb_helper->crtc_info[i].mode_set;
- modeset->x = var->xoffset;
- modeset->y = var->yoffset;
-
- if (modeset->num_connectors) {
- ret = crtc_funcs->mode_set_base(crtc, modeset->x,
- modeset->y,
- crtc->primary->fb);
- if (!ret) {
- info->flags |= FBINFO_HWACCEL_YPAN;
- info->var.xoffset = var->xoffset;
- info->var.yoffset = var->yoffset;
- }
- }
- }
- if (ret)
- info->flags &= ~FBINFO_HWACCEL_YPAN;
- mutex_unlock(&dev->mode_config.mutex);
- return ret;
-}
-
static struct fb_ops viafb_ops = {
.owner = THIS_MODULE,
.fb_check_var = drm_fb_helper_check_var,
commit 0432ca0c343cbd55ebffb5d096e99f86be8e0ac0
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue Aug 22 12:37:16 2017 -0700
Alter the error handling of via_fbdev_init()
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/via_display.c b/drivers/gpu/drm/openchrome/via_display.c
index dc52b3195193..e22113436b0b 100644
--- a/drivers/gpu/drm/openchrome/via_display.c
+++ b/drivers/gpu/drm/openchrome/via_display.c
@@ -539,7 +539,7 @@ via_modeset_init(struct drm_device *dev)
/* Set up the framebuffer device */
ret = via_fbdev_init(dev, &dev_priv->helper);
- if (!ret) {
+ if (ret) {
goto exit;
}
commit bc968b4688636f989074a7a79b16c43f3f9fd850
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue Aug 22 11:35:14 2017 -0700
Calling drm_kms_helper_poll_init() from via_modeset_init
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/via_display.c b/drivers/gpu/drm/openchrome/via_display.c
index 324d47d23e64..dc52b3195193 100644
--- a/drivers/gpu/drm/openchrome/via_display.c
+++ b/drivers/gpu/drm/openchrome/via_display.c
@@ -496,6 +496,7 @@ int
via_modeset_init(struct drm_device *dev)
{
struct via_device *dev_priv = dev->dev_private;
+ int ret = 0;
int i;
drm_mode_config_init(dev);
@@ -536,10 +537,15 @@ via_modeset_init(struct drm_device *dev)
break;
}
- /*
- * Set up the framebuffer device
- */
- return via_fbdev_init(dev, &dev_priv->helper);
+ /* Set up the framebuffer device */
+ ret = via_fbdev_init(dev, &dev_priv->helper);
+ if (!ret) {
+ goto exit;
+ }
+
+ drm_kms_helper_poll_init(dev);
+exit:
+ return ret;
}
void via_modeset_fini(struct drm_device *dev)
diff --git a/drivers/gpu/drm/openchrome/via_fb.c b/drivers/gpu/drm/openchrome/via_fb.c
index c9182d9ce0b7..41b1bca0b44c 100644
--- a/drivers/gpu/drm/openchrome/via_fb.c
+++ b/drivers/gpu/drm/openchrome/via_fb.c
@@ -1218,7 +1218,6 @@ via_fbdev_init(struct drm_device *dev, struct drm_fb_helper **ptr)
drm_fb_helper_single_add_all_connectors(&helper->base);
drm_helper_disable_unused_functions(dev);
drm_fb_helper_initial_config(&helper->base, 32);
- drm_kms_helper_poll_init(dev);
*ptr = (struct drm_fb_helper *) helper;
out_err:
if (ret)
commit 45ac5c19022551ce2c5ad7fb7339b808217755e6
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue Aug 22 11:32:48 2017 -0700
Calling drm_helper_mode_fill_fb_struct before FB initialization
This bug is a logical (design) bug. drm_helper_mode_fill_fb_struct
needs to be called before calling drm_framebuffer_init.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/via_fb.c b/drivers/gpu/drm/openchrome/via_fb.c
index fbbe710c4c70..c9182d9ce0b7 100644
--- a/drivers/gpu/drm/openchrome/via_fb.c
+++ b/drivers/gpu/drm/openchrome/via_fb.c
@@ -974,6 +974,7 @@ via_user_framebuffer_create(struct drm_device *dev,
via_fb->gem_obj = gem_obj;
+ drm_helper_mode_fill_fb_struct(&via_fb->fb, mode_cmd);
ret = drm_framebuffer_init(dev, &via_fb->fb, &via_fb_funcs);
if (ret) {
drm_gem_object_unreference(gem_obj);
@@ -981,8 +982,6 @@ via_user_framebuffer_create(struct drm_device *dev,
return ERR_PTR(ret);
}
- drm_helper_mode_fill_fb_struct(&via_fb->fb, mode_cmd);
-
return &via_fb->fb;
}
@@ -1038,6 +1037,7 @@ via_fb_probe(struct drm_fb_helper *helper,
if (unlikely(ret))
goto out_err;
+ drm_helper_mode_fill_fb_struct(&via_fb->fb, &mode_cmd);
ret = drm_framebuffer_init(helper->dev, &via_fb->fb, &via_fb_funcs);
if (unlikely(ret))
goto out_err;
@@ -1045,7 +1045,6 @@ via_fb_probe(struct drm_fb_helper *helper,
via_fb->gem_obj = gem_obj;
ttmfb->base.fb = &via_fb->fb;
- drm_helper_mode_fill_fb_struct(&via_fb->fb, &mode_cmd);
info->fix.smem_start = kmap->bo->mem.bus.base +
kmap->bo->mem.bus.offset;
info->fix.smem_len = info->screen_size = size;
More information about the Openchrome-devel
mailing list