Skip to content

Commit

Permalink
Merge tag 'fbdev-for-3.11' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/plagnioj/linux-fbdev

Pull fbdev update from Jean-Christophe PLAGNIOL-VILLARD:
 "Various fbdev changes for 3.11
   - xilinxfb updates
   - Small cleanups and fixes to multiple drivers
   - OMAP display subsystem bug updates
   - imxfb dt support"

* tag 'fbdev-for-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/plagnioj/linux-fbdev: (95 commits)
  video: imxfb: Add DT support
  video: i740fb: Make i740fb_init static
  fb: make fp_get_options name argument const
  video: mmp: fix graphics/video layer enable/mask swap issue
  video: mmp: fix memcpy wrong size for mmp_addr issue
  radeon: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)
  aty128fb: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)
  video: of_display_timing.h: Declare 'display_timing'
  fbdev: bfin-lq035q1-fb: Use dev_pm_ops
  fbmem: return -EFAULT on copy_to_user() failure
  OMAPDSS: DPI: Fix wrong pixel clock limit
  video: replace strict_strtoul() with kstrtoul()
  uvesafb: Correct/simplify warning message
  fb: fix atyfb unused data warnings
  fb: fix atyfb build warning
  video: imxfb: Make local symbols static
  video: udlfb: Make local symbol static
  video: udlfb: Use NULL instead of 0
  video: smscufx: Use NULL instead of 0
  video: remove unnecessary platform_set_drvdata()
  ...
  • Loading branch information
torvalds committed Jul 9, 2013
2 parents a82a729 + 1b6c793 commit 5f097cd
Show file tree
Hide file tree
Showing 95 changed files with 8,700 additions and 1,214 deletions.
51 changes: 51 additions & 0 deletions Documentation/devicetree/bindings/video/fsl,imx-fb.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Freescale imx21 Framebuffer

This framebuffer driver supports devices imx1, imx21, imx25, and imx27.

Required properties:
- compatible : "fsl,<chip>-fb", chip should be imx1 or imx21
- reg : Should contain 1 register ranges(address and length)
- interrupts : One interrupt of the fb dev

Required nodes:
- display: Phandle to a display node as described in
Documentation/devicetree/bindings/video/display-timing.txt
Additional, the display node has to define properties:
- bits-per-pixel: Bits per pixel
- fsl,pcr: LCDC PCR value

Optional properties:
- fsl,dmacr: DMA Control Register value. This is optional. By default, the
register is not modified as recommended by the datasheet.
- fsl,lscr1: LCDC Sharp Configuration Register value.

Example:

imxfb: fb@10021000 {
compatible = "fsl,imx21-fb";
interrupts = <61>;
reg = <0x10021000 0x1000>;
display = <&display0>;
};

...

display0: display0 {
model = "Primeview-PD050VL1";
native-mode = <&timing_disp0>;
bits-per-pixel = <16>;
fsl,pcr = <0xf0c88080>; /* non-standard but required */
display-timings {
timing_disp0: 640x480 {
hactive = <640>;
vactive = <480>;
hback-porch = <112>;
hfront-porch = <36>;
hsync-len = <32>;
vback-porch = <33>;
vfront-porch = <33>;
vsync-len = <2>;
clock-frequency = <25000000>;
};
};
};
10 changes: 7 additions & 3 deletions Documentation/devicetree/bindings/video/ssd1307fb.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
* Solomon SSD1307 Framebuffer Driver

Required properties:
- compatible: Should be "solomon,ssd1307fb-<bus>". The only supported bus for
now is i2c.
- compatible: Should be "solomon,<chip>fb-<bus>". The only supported bus for
now is i2c, and the supported chips are ssd1306 and ssd1307.
- reg: Should contain address of the controller on the I2C bus. Most likely
0x3c or 0x3d
- pwm: Should contain the pwm to use according to the OF device tree PWM
specification [0]
specification [0]. Only required for the ssd1307.
- reset-gpios: Should contain the GPIO used to reset the OLED display
- solomon,height: Height in pixel of the screen driven by the controller
- solomon,width: Width in pixel of the screen driven by the controller
- solomon,page-offset: Offset of pages (band of 8 pixels) that the screen is
mapped to.

Optional properties:
- reset-active-low: Is the reset gpio is active on physical low?
Expand Down
46 changes: 39 additions & 7 deletions drivers/gpu/drm/omapdrm/omap_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct omap_crtc {
* mgr->id.) Eventually this will be replaced w/ something
* more common-panel-framework-y
*/
struct omap_overlay_manager mgr;
struct omap_overlay_manager *mgr;

struct omap_video_timings timings;
bool enabled;
Expand Down Expand Up @@ -90,7 +90,32 @@ uint32_t pipe2vbl(struct drm_crtc *crtc)
* job of sequencing the setup of the video pipe in the proper order
*/

/* ovl-mgr-id -> crtc */
static struct omap_crtc *omap_crtcs[8];

/* we can probably ignore these until we support command-mode panels: */
static int omap_crtc_connect(struct omap_overlay_manager *mgr,
struct omap_dss_device *dst)
{
if (mgr->output)
return -EINVAL;

if ((mgr->supported_outputs & dst->id) == 0)
return -EINVAL;

dst->manager = mgr;
mgr->output = dst;

return 0;
}

static void omap_crtc_disconnect(struct omap_overlay_manager *mgr,
struct omap_dss_device *dst)
{
mgr->output->manager = NULL;
mgr->output = NULL;
}

static void omap_crtc_start_update(struct omap_overlay_manager *mgr)
{
}
Expand All @@ -107,7 +132,7 @@ static void omap_crtc_disable(struct omap_overlay_manager *mgr)
static void omap_crtc_set_timings(struct omap_overlay_manager *mgr,
const struct omap_video_timings *timings)
{
struct omap_crtc *omap_crtc = container_of(mgr, struct omap_crtc, mgr);
struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
DBG("%s", omap_crtc->name);
omap_crtc->timings = *timings;
omap_crtc->full_update = true;
Expand All @@ -116,7 +141,7 @@ static void omap_crtc_set_timings(struct omap_overlay_manager *mgr,
static void omap_crtc_set_lcd_config(struct omap_overlay_manager *mgr,
const struct dss_lcd_mgr_config *config)
{
struct omap_crtc *omap_crtc = container_of(mgr, struct omap_crtc, mgr);
struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
DBG("%s", omap_crtc->name);
dispc_mgr_set_lcd_config(omap_crtc->channel, config);
}
Expand All @@ -135,6 +160,8 @@ static void omap_crtc_unregister_framedone_handler(
}

static const struct dss_mgr_ops mgr_ops = {
.connect = omap_crtc_connect,
.disconnect = omap_crtc_disconnect,
.start_update = omap_crtc_start_update,
.enable = omap_crtc_enable,
.disable = omap_crtc_disable,
Expand Down Expand Up @@ -569,7 +596,7 @@ static void omap_crtc_pre_apply(struct omap_drm_apply *apply)
} else {
if (encoder) {
omap_encoder_set_enabled(encoder, false);
omap_encoder_update(encoder, &omap_crtc->mgr,
omap_encoder_update(encoder, omap_crtc->mgr,
&omap_crtc->timings);
omap_encoder_set_enabled(encoder, true);
omap_crtc->full_update = false;
Expand All @@ -595,6 +622,11 @@ static const char *channel_names[] = {
[OMAP_DSS_CHANNEL_LCD2] = "lcd2",
};

void omap_crtc_pre_init(void)
{
dss_install_mgr_ops(&mgr_ops);
}

/* initialize crtc */
struct drm_crtc *omap_crtc_init(struct drm_device *dev,
struct drm_plane *plane, enum omap_channel channel, int id)
Expand Down Expand Up @@ -635,9 +667,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
omap_irq_register(dev, &omap_crtc->error_irq);

/* temporary: */
omap_crtc->mgr.id = channel;

dss_install_mgr_ops(&mgr_ops);
omap_crtc->mgr = omap_dss_get_overlay_manager(channel);

/* TODO: fix hard-coded setup.. add properties! */
info = &omap_crtc->info;
Expand All @@ -651,6 +681,8 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,

omap_plane_install_properties(omap_crtc->plane, &crtc->base);

omap_crtcs[channel] = omap_crtc;

return crtc;

fail:
Expand Down
27 changes: 21 additions & 6 deletions drivers/gpu/drm/omapdrm/omap_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ static int get_connector_type(struct omap_dss_device *dssdev)
switch (dssdev->type) {
case OMAP_DISPLAY_TYPE_HDMI:
return DRM_MODE_CONNECTOR_HDMIA;
case OMAP_DISPLAY_TYPE_DPI:
if (!strcmp(dssdev->name, "dvi"))
return DRM_MODE_CONNECTOR_DVID;
/* fallthrough */
case OMAP_DISPLAY_TYPE_DVI:
return DRM_MODE_CONNECTOR_DVID;
default:
return DRM_MODE_CONNECTOR_Unknown;
}
Expand Down Expand Up @@ -97,6 +95,9 @@ static int omap_modeset_init(struct drm_device *dev)
int num_mgrs = dss_feat_get_num_mgrs();
int num_crtcs;
int i, id = 0;
int r;

omap_crtc_pre_init();

drm_mode_config_init(dev);

Expand All @@ -116,6 +117,7 @@ static int omap_modeset_init(struct drm_device *dev)
struct drm_connector *connector;
struct drm_encoder *encoder;
enum omap_channel channel;
struct omap_overlay_manager *mgr;

if (!dssdev->driver) {
dev_warn(dev->dev, "%s has no driver.. skipping it\n",
Expand All @@ -131,6 +133,13 @@ static int omap_modeset_init(struct drm_device *dev)
continue;
}

r = dssdev->driver->connect(dssdev);
if (r) {
dev_err(dev->dev, "could not connect display: %s\n",
dssdev->name);
continue;
}

encoder = omap_encoder_init(dev, dssdev);

if (!encoder) {
Expand Down Expand Up @@ -172,8 +181,9 @@ static int omap_modeset_init(struct drm_device *dev)
* other possible channels to which the encoder can connect are
* not considered.
*/
channel = dssdev->output->dispc_channel;

mgr = omapdss_find_mgr_from_display(dssdev);
channel = mgr->id;
/*
* if this channel hasn't already been taken by a previously
* allocated crtc, we create a new crtc for it
Expand Down Expand Up @@ -247,6 +257,9 @@ static int omap_modeset_init(struct drm_device *dev)
struct drm_encoder *encoder = priv->encoders[i];
struct omap_dss_device *dssdev =
omap_encoder_get_dssdev(encoder);
struct omap_dss_device *output;

output = omapdss_find_output_from_display(dssdev);

/* figure out which crtc's we can connect the encoder to: */
encoder->possible_crtcs = 0;
Expand All @@ -259,9 +272,11 @@ static int omap_modeset_init(struct drm_device *dev)
supported_outputs =
dss_feat_get_supported_outputs(crtc_channel);

if (supported_outputs & dssdev->output->id)
if (supported_outputs & output->id)
encoder->possible_crtcs |= (1 << id);
}

omap_dss_put_device(output);
}

DBG("registered %d planes, %d crtcs, %d encoders and %d connectors\n",
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/omapdrm/omap_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ const struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc);
enum omap_channel omap_crtc_channel(struct drm_crtc *crtc);
int omap_crtc_apply(struct drm_crtc *crtc,
struct omap_drm_apply *apply);
void omap_crtc_pre_init(void);
struct drm_crtc *omap_crtc_init(struct drm_device *dev,
struct drm_plane *plane, enum omap_channel channel, int id);

Expand Down
4 changes: 3 additions & 1 deletion drivers/video/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ config FB_IMX
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
select FB_MODE_HELPERS
select VIDEOMODE_HELPERS

config FB_CYBER2000
tristate "CyberPro 2000/2010/5000 support"
Expand Down Expand Up @@ -2188,7 +2190,7 @@ config FB_PS3_DEFAULT_SIZE_M

config FB_XILINX
tristate "Xilinx frame buffer support"
depends on FB && (XILINX_VIRTEX || MICROBLAZE)
depends on FB && (XILINX_VIRTEX || MICROBLAZE || ARCH_ZYNQ)
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/aty/aty128fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,7 @@ static int aty128_init(struct pci_dev *pdev, const struct pci_device_id *ent)

aty128_init_engine(par);

par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM);
par->pm_reg = pdev->pm_cap;
par->pdev = pdev;
par->asleep = 0;
par->lock_blank = 0;
Expand Down
9 changes: 5 additions & 4 deletions drivers/video/aty/atyfb_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/delay.h>
#include <linux/compiler.h>
#include <linux/console.h>
#include <linux/fb.h>
#include <linux/init.h>
Expand Down Expand Up @@ -434,8 +435,8 @@ static int correct_chipset(struct atyfb_par *par)
const char *name;
int i;

for (i = ARRAY_SIZE(aty_chips) - 1; i >= 0; i--)
if (par->pci_id == aty_chips[i].pci_id)
for (i = ARRAY_SIZE(aty_chips); i > 0; i--)
if (par->pci_id == aty_chips[i - 1].pci_id)
break;

if (i < 0)
Expand Down Expand Up @@ -531,8 +532,8 @@ static int correct_chipset(struct atyfb_par *par)
return 0;
}

static char ram_dram[] = "DRAM";
static char ram_resv[] = "RESV";
static char ram_dram[] __maybe_unused = "DRAM";
static char ram_resv[] __maybe_unused = "RESV";
#ifdef CONFIG_FB_ATY_GX
static char ram_vram[] = "VRAM";
#endif /* CONFIG_FB_ATY_GX */
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/aty/radeon_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2805,7 +2805,7 @@ static void radeonfb_early_resume(void *data)
void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep)
{
/* Find PM registers in config space if any*/
rinfo->pm_reg = pci_find_capability(rinfo->pdev, PCI_CAP_ID_PM);
rinfo->pm_reg = rinfo->pdev->pm_cap;

/* Enable/Disable dynamic clocks: TODO add sysfs access */
if (rinfo->family == CHIP_FAMILY_RS480)
Expand Down
1 change: 0 additions & 1 deletion drivers/video/au1100fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,6 @@ static int au1100fb_drv_probe(struct platform_device *dev)
if (fbdev->info.cmap.len != 0) {
fb_dealloc_cmap(&fbdev->info.cmap);
}
platform_set_drvdata(dev, NULL);

return -ENODEV;
}
Expand Down
1 change: 0 additions & 1 deletion drivers/video/bf54x-lq043fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,6 @@ static int bfin_bf54x_probe(struct platform_device *pdev)
out2:
free_dma(CH_EPPI0);
out1:
platform_set_drvdata(pdev, NULL);

return ret;
}
Expand Down
Loading

0 comments on commit 5f097cd

Please sign in to comment.