Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358196
b: refs/heads/master
c: 7083e05
h: refs/heads/master
v: v3
  • Loading branch information
Ben Widawsky authored and Daniel Vetter committed Feb 13, 2013
1 parent 1e82c1e commit be709eb
Show file tree
Hide file tree
Showing 60 changed files with 446 additions and 562 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 35f8badc1cf652381fa3f82c1fbea39f4dbe87fd
refs/heads/master: 7083e05072b88d503d257b6f012ce56367f3ac97
1 change: 0 additions & 1 deletion trunk/Documentation/DocBook/drm.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,6 @@ void intel_crt_init(struct drm_device *dev)
<title>fbdev Helper Functions Reference</title>
!Pdrivers/gpu/drm/drm_fb_helper.c fbdev helpers
!Edrivers/gpu/drm/drm_fb_helper.c
!Iinclude/drm/drm_fb_helper.h
</sect2>
<sect2>
<title>Display Port Helper Functions Reference</title>
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/gpu/drm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,3 @@ source "drivers/gpu/drm/cirrus/Kconfig"
source "drivers/gpu/drm/shmobile/Kconfig"

source "drivers/gpu/drm/tegra/Kconfig"

source "drivers/gpu/drm/omapdrm/Kconfig"
1 change: 0 additions & 1 deletion trunk/drivers/gpu/drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ obj-$(CONFIG_DRM_UDL) += udl/
obj-$(CONFIG_DRM_AST) += ast/
obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/
obj-$(CONFIG_DRM_TEGRA) += tegra/
obj-$(CONFIG_DRM_OMAP) += omapdrm/
obj-y += i2c/
26 changes: 18 additions & 8 deletions trunk/drivers/gpu/drm/ast/ast_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include <drm/drmP.h>
#include <drm/drm_crtc.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_crtc_helper.h>
#include "ast_drv.h"

static void ast_dirty_update(struct ast_fbdev *afbdev,
Expand Down Expand Up @@ -146,10 +145,9 @@ static int astfb_create_object(struct ast_fbdev *afbdev,
return ret;
}

static int astfb_create(struct drm_fb_helper *helper,
static int astfb_create(struct ast_fbdev *afbdev,
struct drm_fb_helper_surface_size *sizes)
{
struct ast_fbdev *afbdev = (struct ast_fbdev *)helper;
struct drm_device *dev = afbdev->helper.dev;
struct drm_mode_fb_cmd2 mode_cmd;
struct drm_framebuffer *fb;
Expand Down Expand Up @@ -250,10 +248,26 @@ static void ast_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
*blue = ast_crtc->lut_b[regno] << 8;
}

static int ast_find_or_create_single(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes)
{
struct ast_fbdev *afbdev = (struct ast_fbdev *)helper;
int new_fb = 0;
int ret;

if (!helper->fb) {
ret = astfb_create(afbdev, sizes);
if (ret)
return ret;
new_fb = 1;
}
return new_fb;
}

static struct drm_fb_helper_funcs ast_fb_helper_funcs = {
.gamma_set = ast_fb_gamma_set,
.gamma_get = ast_fb_gamma_get,
.fb_probe = astfb_create,
.fb_probe = ast_find_or_create_single,
};

static void ast_fbdev_destroy(struct drm_device *dev,
Expand Down Expand Up @@ -300,10 +314,6 @@ int ast_fbdev_init(struct drm_device *dev)
}

drm_fb_helper_single_add_all_connectors(&afbdev->helper);

/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(dev);

drm_fb_helper_initial_config(&afbdev->helper, 32);
return 0;
}
Expand Down
26 changes: 19 additions & 7 deletions trunk/drivers/gpu/drm/cirrus/cirrus_fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <linux/module.h>
#include <drm/drmP.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_crtc_helper.h>

#include <linux/fb.h>

Expand Down Expand Up @@ -121,10 +120,9 @@ static int cirrusfb_create_object(struct cirrus_fbdev *afbdev,
return ret;
}

static int cirrusfb_create(struct drm_fb_helper *helper,
static int cirrusfb_create(struct cirrus_fbdev *gfbdev,
struct drm_fb_helper_surface_size *sizes)
{
struct cirrus_fbdev *gfbdev = (struct cirrus_fbdev *)helper;
struct drm_device *dev = gfbdev->helper.dev;
struct cirrus_device *cdev = gfbdev->helper.dev->dev_private;
struct fb_info *info;
Expand Down Expand Up @@ -221,6 +219,23 @@ static int cirrusfb_create(struct drm_fb_helper *helper,
return ret;
}

static int cirrus_fb_find_or_create_single(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size
*sizes)
{
struct cirrus_fbdev *gfbdev = (struct cirrus_fbdev *)helper;
int new_fb = 0;
int ret;

if (!helper->fb) {
ret = cirrusfb_create(gfbdev, sizes);
if (ret)
return ret;
new_fb = 1;
}
return new_fb;
}

static int cirrus_fbdev_destroy(struct drm_device *dev,
struct cirrus_fbdev *gfbdev)
{
Expand Down Expand Up @@ -252,7 +267,7 @@ static int cirrus_fbdev_destroy(struct drm_device *dev,
static struct drm_fb_helper_funcs cirrus_fb_helper_funcs = {
.gamma_set = cirrus_crtc_fb_gamma_set,
.gamma_get = cirrus_crtc_fb_gamma_get,
.fb_probe = cirrusfb_create,
.fb_probe = cirrus_fb_find_or_create_single,
};

int cirrus_fbdev_init(struct cirrus_device *cdev)
Expand All @@ -276,9 +291,6 @@ int cirrus_fbdev_init(struct cirrus_device *cdev)
return ret;
}
drm_fb_helper_single_add_all_connectors(&gfbdev->helper);

/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(cdev->dev);
drm_fb_helper_initial_config(&gfbdev->helper, bpp_sel);

return 0;
Expand Down
18 changes: 2 additions & 16 deletions trunk/drivers/gpu/drm/drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,8 @@ void drm_modeset_unlock_all(struct drm_device *dev)

mutex_unlock(&dev->mode_config.mutex);
}
EXPORT_SYMBOL(drm_modeset_unlock_all);

/**
* drm_warn_on_modeset_not_all_locked - check that all modeset locks are locked
* @dev: device
*/
void drm_warn_on_modeset_not_all_locked(struct drm_device *dev)
{
struct drm_crtc *crtc;

list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
WARN_ON(!mutex_is_locked(&crtc->mutex));

WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
}
EXPORT_SYMBOL(drm_warn_on_modeset_not_all_locked);
EXPORT_SYMBOL(drm_modeset_unlock_all);

/* Avoid boilerplate. I'm tired of typing. */
#define DRM_ENUM_NAME_FN(fnname, list) \
Expand Down Expand Up @@ -1996,9 +1982,9 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
plane_req->src_w, plane_req->src_h);
if (!ret) {
old_fb = plane->fb;
fb = NULL;
plane->crtc = crtc;
plane->fb = fb;
fb = NULL;
}
drm_modeset_unlock_all(dev);

Expand Down
9 changes: 2 additions & 7 deletions trunk/drivers/gpu/drm/drm_edid.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,10 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
break;
}
}

if (i == 4 && print_bad_edid) {
if (i == 4)
dev_warn(connector->dev->dev,
"%s: Ignoring invalid EDID block %d.\n",
drm_get_connector_name(connector), j);

connector->bad_edid_counter++;
}
}

if (valid_extensions != block[0x7e]) {
Expand Down Expand Up @@ -2054,8 +2050,7 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
num_modes += add_cvt_modes(connector, edid);
num_modes += add_standard_modes(connector, edid);
num_modes += add_established_modes(connector, edid);
if (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF)
num_modes += add_inferred_modes(connector, edid);
num_modes += add_inferred_modes(connector, edid);
num_modes += add_cea_modes(connector, edid);

if (quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75))
Expand Down
27 changes: 17 additions & 10 deletions trunk/drivers/gpu/drm/drm_fb_cma_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,23 @@ static int drm_fbdev_cma_create(struct drm_fb_helper *helper,
return ret;
}

static int drm_fbdev_cma_probe(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes)
{
int ret = 0;

if (!helper->fb) {
ret = drm_fbdev_cma_create(helper, sizes);
if (ret < 0)
return ret;
ret = 1;
}

return ret;
}

static struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = {
.fb_probe = drm_fbdev_cma_create,
.fb_probe = drm_fbdev_cma_probe,
};

/**
Expand Down Expand Up @@ -318,9 +333,6 @@ struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev,

}

/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(dev);

ret = drm_fb_helper_initial_config(helper, preferred_bpp);
if (ret < 0) {
dev_err(dev->dev, "Failed to set inital hw configuration.\n");
Expand Down Expand Up @@ -377,13 +389,8 @@ EXPORT_SYMBOL_GPL(drm_fbdev_cma_fini);
*/
void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma)
{
if (fbdev_cma) {
struct drm_device *dev = fbdev_cma->fb_helper.dev;

drm_modeset_lock_all(dev);
if (fbdev_cma)
drm_fb_helper_restore_fbdev_mode(&fbdev_cma->fb_helper);
drm_modeset_unlock_all(dev);
}
}
EXPORT_SYMBOL_GPL(drm_fbdev_cma_restore_mode);

Expand Down
Loading

0 comments on commit be709eb

Please sign in to comment.