Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Re: [PATCH RFC 3/3] video: Kconfig: move drm and fb into separate menus
From: Jingoo Han @ 2014-02-17  1:55 UTC (permalink / raw)
  To: 'Tomi Valkeinen', linux-fbdev, dri-devel, linux-kernel
  Cc: 'Laurent Pinchart', 'Geert Uytterhoeven',
	'Jean-Christophe Plagniol-Villard',
	'David Airlie', 'Jingoo Han'
In-Reply-To: <1392376711-11290-3-git-send-email-tomi.valkeinen@ti.com>

On Friday, February 14, 2014 8:19 PM, Tomi Valkeinen wrote:
> 
> At the moment the "Device Drivers / Graphics support" kernel config page
> looks rather messy, with DRM and fbdev driver selections on the same
> page, some on the top level Graphics support page, some under their
> respective subsystems.
> 
> If I'm not mistaken, this is caused by the drivers depending on other
> things than DRM or FB, which causes Kconfig to arrange the options in
> not-so-neat manner.
> 
> Both DRM and FB have a main menuconfig option for the whole DRM or FB
> subsystem. Optimally, this would be enough to arrange all DRM and FB
> options under the respective subsystem, but for whatever reason this
> doesn't work reliably.
> 
> This patch adds an explicit submenu for DRM and FB, making it much
> clearer which options are related to FB, and which to DRM.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

Reviewed-by: Jingoo Han <jg1.han@samsung.com>

I tested this patch. Menu becomes clearer!
Thanks.

Best regards,
Jingoo Han

> ---
>  drivers/video/Kconfig | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
> index f0f26a0b746e..70d174090a54 100644
> --- a/drivers/video/Kconfig
> +++ b/drivers/video/Kconfig
> @@ -21,9 +21,13 @@ source "drivers/gpu/vga/Kconfig"
> 
>  source "drivers/gpu/host1x/Kconfig"
> 
> +menu "Direct Rendering Manager"
>  source "drivers/gpu/drm/Kconfig"
> +endmenu
> 
> +menu "Framebuffer Devices"
>  source "drivers/video/fbdev/Kconfig"
> +endmenu
> 
>  source "drivers/video/backlight/Kconfig"
> 
> --
> 1.8.3.2



^ permalink raw reply

* Re: [PATCH 1/5] video: imxfb: Remove dead declaration of set_imx_fb_info()
From: Sascha Hauer @ 2014-02-17  7:02 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1392443786-30527-1-git-send-email-shc_work@mail.ru>

On Sat, Feb 15, 2014 at 09:56:22AM +0400, Alexander Shiyan wrote:
> Function set_imx_fb_info() is missing in the kernel code,
> so remove the dead declaration.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

Nice cleanup to this driver!

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply

* Re: [PATCH v2 4/4] video: mmp: add device tree support
From: Mark Rutland @ 2014-02-17 14:37 UTC (permalink / raw)
  To: Zhou Zhu
  Cc: linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Tomi Valkeinen, Jean-Christophe Plagniol-Villard, Haojian Zhuang,
	Sascha Hauer, Jingoo Han,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Chao Xie,
	Guoqing Li
In-Reply-To: <1389698184-28761-5-git-send-email-zzhu3-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>

On Tue, Jan 14, 2014 at 11:16:24AM +0000, Zhou Zhu wrote:
> add device tree support for mmp fb/controller
> the description of DT config is at
> Documentation/devicetree/bindings/fb/mmp-disp.txt
> 
> Signed-off-by: Zhou Zhu <zzhu3@marvell.com>
> ---
>  Documentation/devicetree/bindings/fb/mmp-disp.txt |   60 ++++++++
>  drivers/video/mmp/fb/mmpfb.c                      |   73 ++++++----
>  drivers/video/mmp/hw/mmp_ctrl.c                   |  160 ++++++++++++++++-----
>  3 files changed, 235 insertions(+), 58 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/fb/mmp-disp.txt
> 
> diff --git a/Documentation/devicetree/bindings/fb/mmp-disp.txt b/Documentation/devicetree/bindings/fb/mmp-disp.txt
> new file mode 100644
> index 0000000..80702f5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/fb/mmp-disp.txt
> @@ -0,0 +1,60 @@
> +* Marvell MMP Display (MMP_DISP)
> +
> +To config mmp display, 3 parts are required to be set in dts:
> +1. mmp fb
> +Required properties:
> +- compatible: Should be "marvell,<soc>-fb".

Please list the precise values and when they should be used. It makes
searching for them _far_ easier.

> +- marvell,path: Should be the path this fb connecting to.

What type is this? The example implies a phandle.

What type of node does this point to?

It's not explained at this point and it's really unclear what this is.

> +- marvell,overlay-id: Should be the id of overlay this fb is on.
> +- marvell,dmafetch-id: Should be the dma fetch id this fb using.

Are these hardware properties?

Is there any documentation which could make this clearer?

> +- marvell,default-pixfmt: Should be the default pixel format when this fb is
> +turned on.

What format is this? The example is useless. If this is a standard
binding, please refer to the binding document.

> +
> +2. mmp controller
> +Required properties:
> +- compatible: Should be "marvell,<soc>-disp".

Please list the precise set of values.

> +- reg: Should be address and length of the register set for this controller.
> +- interrupts: Should be interrupt of this controller.

Just to check: the device only has on interrupt?

> +
> +Required sub-node:
> +- path:
> +Required properties in this sub-node:
> +-- marvell,overlay_num: Should be number of overlay this path has.

s/_/-/ in property names please.

num-overlays would be a clearer name.

> +-- marvell,output-type: Should be output-type settings
> +-- marvell,path-config: Should be path-config settings
> +-- marvell,link-config: Should be link-config settings
> +-- marvell,rbswap: Should be rbswap settings

These are completely opaque to me. Please describe what these are either
in place or in reference to standard bindings.

Is rbswap a boolean value?

[...]

> +       if (!path_np || of_property_read_u32(path_np, "marvell,overlay-num",
> +                               &path_info->output_type) ||
> +                       of_property_read_u32(path_np, "marvell,output-type",
> +                               &path_info->overlay_num)) {

These are reading into the wrong variables.

Cheers,
Mark.

^ permalink raw reply

* Re: [PATCH 0/10] framebuffer patches
From: Mikulas Patocka @ 2014-02-17 17:15 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <alpine.LRH.2.02.1401231436400.7971@file01.intranet.prod.int.rdu2.redhat.com>



On Tue, 11 Feb 2014, Tomi Valkeinen wrote:

> On 11/02/14 14:58, Tomi Valkeinen wrote:
> > On 23/01/14 21:37, Mikulas Patocka wrote:
> >> Hi
> >>
> >> Here I'm sending some framebuffer patches for matrox, mach64, tga and a 
> >> fix for copying on vesafb.
> >>
> >> Mikulas
> >>
> > 
> > Looks fine to me. Queuing for 3.15.
> 
> Oh, I did some conflict resolution on "tgafb: fix mode setting with
> fbset". It was trivial, so I think I got it right. But please check
> anyway in a few days when these get into linux-next.
> 
>  Tomi

Hi

Your change it OK, I tested it.

Mikulas

^ permalink raw reply

* [PATCH] video: da8xx-fb: Use "SIMPLE_DEV_PM_OPS" macro
From: Manish Badarkhe @ 2014-02-18  3:37 UTC (permalink / raw)
  To: linux-kernel, linux-fbdev, davinci-linux-open-source
  Cc: tomi.valkeinen, plagnioj, nsekhar, badarkhe.manish

Update driver to use SIMPLE_DEV_PM_OPS macro for power
management suspend and resume operations.

Signed-off-by: Manish Badarkhe <badarkhe.manish@gmail.com>
---
:100644 100644 a1d74dd... 0c0ba92... M	drivers/video/da8xx-fb.c
 drivers/video/da8xx-fb.c |   22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index a1d74dd..0c0ba92 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -1546,7 +1546,7 @@ err_pm_runtime_disable:
 	return ret;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static struct lcdc_context {
 	u32 clk_enable;
 	u32 ctrl;
@@ -1610,9 +1610,9 @@ static void lcd_context_restore(void)
 	return;
 }
 
-static int fb_suspend(struct platform_device *dev, pm_message_t state)
+static int fb_suspend(struct device *dev)
 {
-	struct fb_info *info = platform_get_drvdata(dev);
+	struct fb_info *info = dev_get_drvdata(dev);
 	struct da8xx_fb_par *par = info->par;
 
 	console_lock();
@@ -1622,18 +1622,18 @@ static int fb_suspend(struct platform_device *dev, pm_message_t state)
 	fb_set_suspend(info, 1);
 	lcd_disable_raster(DA8XX_FRAME_WAIT);
 	lcd_context_save();
-	pm_runtime_put_sync(&dev->dev);
+	pm_runtime_put_sync(dev);
 	console_unlock();
 
 	return 0;
 }
-static int fb_resume(struct platform_device *dev)
+static int fb_resume(struct device *dev)
 {
-	struct fb_info *info = platform_get_drvdata(dev);
+	struct fb_info *info = dev_get_drvdata(dev);
 	struct da8xx_fb_par *par = info->par;
 
 	console_lock();
-	pm_runtime_get_sync(&dev->dev);
+	pm_runtime_get_sync(dev);
 	lcd_context_restore();
 	if (par->blank = FB_BLANK_UNBLANK) {
 		lcd_enable_raster();
@@ -1647,19 +1647,17 @@ static int fb_resume(struct platform_device *dev)
 
 	return 0;
 }
-#else
-#define fb_suspend NULL
-#define fb_resume NULL
 #endif
 
+static SIMPLE_DEV_PM_OPS(fb_pm_ops, fb_suspend, fb_resume);
+
 static struct platform_driver da8xx_fb_driver = {
 	.probe = fb_probe,
 	.remove = fb_remove,
-	.suspend = fb_suspend,
-	.resume = fb_resume,
 	.driver = {
 		   .name = DRIVER_NAME,
 		   .owner = THIS_MODULE,
+		   .pm	= &fb_pm_ops,
 		   },
 };
 module_platform_driver(da8xx_fb_driver);
-- 
1.7.10.4


^ permalink raw reply related

* Dear
From: Dr. Pius Okagba @ 2014-02-18 11:36 UTC (permalink / raw)
  To: linux-fbdev

Attention:
Regarding the transaction made so far, I waited for your message as you told 
me
with none received. Remember, I supposed to have traveled last night 
but the
weather is too bad. I will be leaving to Paraguay tomorrow for estate project.
Meanwhile, contact the Bank manager with below address, i have kept the cheque
worth of USD2.5M. They will either mail it to you or remit it for transfer
depending on how you want it; Here is Bank contact information:
 
Name Of Manager: Mr. Franklin Barnard
MAIL: (franklinb1@barid.com,
okagbapius1@live.com
Thank you
UN Office.

^ permalink raw reply

* Re: [PATCH 1/2] OMAPDSS: use DISPC register to detect context loss
From: Archit Taneja @ 2014-02-18 11:51 UTC (permalink / raw)
  To: Tomi Valkeinen, linux-fbdev, linux-omap; +Cc: Nishanth Menon
In-Reply-To: <1392366572-31729-1-git-send-email-tomi.valkeinen@ti.com>

On Friday 14 February 2014 01:59 PM, Tomi Valkeinen wrote:
> Instead of relying on the OMAP specific
> omap_pm_get_dev_context_loss_count() to detect register context loss, we
> can achieve the same in a much simpler way by just observing the DISPC
> registers.
>
> We always set DISPC's load mode to LOAD_FRAME_ONLY, which is not the
> reset value. Thus we can just observe the load mode to see if we have
> lost register context.

Nice trick :p

Reviewed-by: Archit Taneja <archit@ti.com>

Archit

>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>   drivers/video/omap2/dss/dispc.c | 24 +++++++++++-------------
>   1 file changed, 11 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index bbeb8dd7f108..1659aa912d2b 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -100,8 +100,6 @@ static struct {
>   	struct platform_device *pdev;
>   	void __iomem    *base;
>
> -	int		ctx_loss_cnt;
> -
>   	int irq;
>
>   	unsigned long core_clk_rate;
> @@ -357,29 +355,20 @@ static void dispc_save_context(void)
>   	if (dss_has_feature(FEAT_CORE_CLK_DIV))
>   		SR(DIVISOR);
>
> -	dispc.ctx_loss_cnt = dss_get_ctx_loss_count();
>   	dispc.ctx_valid = true;
>
> -	DSSDBG("context saved, ctx_loss_count %d\n", dispc.ctx_loss_cnt);
> +	DSSDBG("context saved\n");
>   }
>
>   static void dispc_restore_context(void)
>   {
> -	int i, j, ctx;
> +	int i, j;
>
>   	DSSDBG("dispc_restore_context\n");
>
>   	if (!dispc.ctx_valid)
>   		return;
>
> -	ctx = dss_get_ctx_loss_count();
> -
> -	if (ctx >= 0 && ctx = dispc.ctx_loss_cnt)
> -		return;
> -
> -	DSSDBG("ctx_loss_count: saved %d, current %d\n",
> -			dispc.ctx_loss_cnt, ctx);
> -
>   	/*RR(IRQENABLE);*/
>   	/*RR(CONTROL);*/
>   	RR(CONFIG);
> @@ -3768,6 +3757,15 @@ static int dispc_runtime_suspend(struct device *dev)
>
>   static int dispc_runtime_resume(struct device *dev)
>   {
> +	/*
> +	 * The reset value for load mode is 0 (OMAP_DSS_LOAD_CLUT_AND_FRAME)
> +	 * but we always initialize it to 2 (OMAP_DSS_LOAD_FRAME_ONLY) in
> +	 * _omap_dispc_initial_config(). We can thus use it to detect if
> +	 * we have lost register context.
> +	 */
> +	if (REG_GET(DISPC_CONFIG, 2, 1) = OMAP_DSS_LOAD_FRAME_ONLY)
> +		return 0;
> +
>   	_omap_dispc_initial_config();
>
>   	dispc_restore_context();
>


^ permalink raw reply

* Re: [PATCH 1/9] Doc/DT: Add OMAP DSS DT Bindings
From: Archit Taneja @ 2014-02-18 11:55 UTC (permalink / raw)
  To: Tomi Valkeinen, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1392294752-18762-2-git-send-email-tomi.valkeinen-l0cyMroinI0@public.gmane.org>

Hi,

On Thursday 13 February 2014 06:02 PM, Tomi Valkeinen wrote:
> Add device tree bindings for OMAP Display Subsystem for the following
> SoCs: OMAP2, OMAP3, OMAP4.


>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---

<snip>

> +A shortened example of the board description for OMAP4 Panda board, defined in
> +omap4-panda.dts.
> +
> +The Panda board has a DVI and a HDMI connector, and the board contains a TFP410
> +chip (MIPI DPI to DVI encoder) and a TPD12S015 chip (HDMI ESD protection & level
> +shifter). The video pipelines for the connectors are formed as follows:
> +
> +DSS Core --(MIPI DPI)--> TFP410 --(DVI)--> DVI Connector
> +OMAP HDMI --(HDMI)--> TPD12S015 --(HDMI)--> HDMI COnnector

Nitpick - 'CO' -> 'Co'

Archit


^ permalink raw reply

* Re: [PATCH 0/9] OMAP DSS DT bindings documentation
From: Archit Taneja @ 2014-02-18 12:21 UTC (permalink / raw)
  To: Tomi Valkeinen, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1392294752-18762-1-git-send-email-tomi.valkeinen-l0cyMroinI0@public.gmane.org>

Hi,

On Thursday 13 February 2014 06:02 PM, Tomi Valkeinen wrote:
> Hi,
>
> Here is DT binding documentation for OMAP Display Subsystem. I've sent these
> earlier as part of the whole DSS DT series, but I'm now sending them separately
> to get comments for them.
>
> These patches are essentially the same as what I already sent earlier. The only
> difference is that I added clock information for omap3 and omap4 platforms.

Reviewed-by: Archit Taneja <archit@ti.com>

Archit


^ permalink raw reply

* [PATCH 0/2] Re-sending two patches for hyperv_fb
From: Haiyang Zhang @ 2014-02-18 20:20 UTC (permalink / raw)
  To: plagnioj, tomi.valkeinen, akpm, linux-fbdev
  Cc: olaf, jasowang, driverdev-devel, linux-kernel, haiyangz

They were sent out during tree closing, I'm re-sending them now.

Haiyang Zhang (2):
  hyperv_fb: Add screen refresh after pause/resume operation
  hyperv_fb: Add support for Gen2 VM

 drivers/video/hyperv_fb.c |   70 ++++++++++++++++++++++++++++++++-------------
 1 files changed, 50 insertions(+), 20 deletions(-)

-- 
1.7.4.1


^ permalink raw reply

* [PATCH 1/2] hyperv_fb: Add screen refresh after pause/resume operation
From: Haiyang Zhang @ 2014-02-18 20:20 UTC (permalink / raw)
  To: plagnioj, tomi.valkeinen, akpm, linux-fbdev
  Cc: olaf, jasowang, driverdev-devel, linux-kernel, haiyangz
In-Reply-To: <1392757891-28680-1-git-send-email-haiyangz@microsoft.com>

This is necessary because after VM is pause/resumed, some portion of
the screen may need refresh.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/video/hyperv_fb.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c
index 130708f..bbcc8c0 100644
--- a/drivers/video/hyperv_fb.c
+++ b/drivers/video/hyperv_fb.c
@@ -218,6 +218,7 @@ struct hvfb_par {
 
 	struct delayed_work dwork;
 	bool update;
+	bool xrefresh;
 
 	u32 pseudo_palette[16];
 	u8 init_buf[MAX_VMBUS_PKT_SIZE];
@@ -369,7 +370,7 @@ static void synthvid_recv_sub(struct hv_device *hdev)
 			synthvid_send_situ(hdev);
 		}
 
-		par->update = msg->feature_chg.is_dirt_needed;
+		par->xrefresh = par->update = msg->feature_chg.is_dirt_needed;
 		if (par->update)
 			schedule_delayed_work(&par->dwork, HVFB_UPDATE_DELAY);
 	}
@@ -522,6 +523,13 @@ static void hvfb_update_work(struct work_struct *w)
 {
 	struct hvfb_par *par = container_of(w, struct hvfb_par, dwork.work);
 	struct fb_info *info = par->info;
+	char *argv[] = {"/usr/bin/xrefresh", "-display", ":0.0", NULL};
+	char *envp[] = {"HOME=/", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
+
+	if (par->xrefresh) {
+		par->xrefresh = false;
+		call_usermodehelper(argv[0], argv, envp, UMH_NO_WAIT);
+	}
 
 	if (par->fb_ready)
 		synthvid_update(info);
-- 
1.7.4.1


^ permalink raw reply related

* [PATCH 2/2] hyperv_fb: Add support for Gen2 VM
From: Haiyang Zhang @ 2014-02-18 20:22 UTC (permalink / raw)
  To: plagnioj, tomi.valkeinen, akpm, linux-fbdev
  Cc: olaf, jasowang, driverdev-devel, linux-kernel, haiyangz
In-Reply-To: <1392757891-28680-1-git-send-email-haiyangz@microsoft.com>

This patch enables Hyper-V FB driver to run on Gen2 VM.

The Gen2 VM provides MMIO area for synthetic video from ACPI module,
which is exported by vmbus. The generic video is provided by UEFI. PCI
video in Gen1 is no longer available.

To support synthetic video on Hyper-V Gen2 VM, this patch updated
code related to the changes above.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/video/hyperv_fb.c |   60 ++++++++++++++++++++++++++++++--------------
 1 files changed, 41 insertions(+), 19 deletions(-)

diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c
index bbcc8c0..5db1f20 100644
--- a/drivers/video/hyperv_fb.c
+++ b/drivers/video/hyperv_fb.c
@@ -42,6 +42,7 @@
 #include <linux/completion.h>
 #include <linux/fb.h>
 #include <linux/pci.h>
+#include <linux/efi.h>
 
 #include <linux/hyperv.h>
 
@@ -461,13 +462,13 @@ static int synthvid_connect_vsp(struct hv_device *hdev)
 		goto error;
 	}
 
-	if (par->synthvid_version = SYNTHVID_VERSION_WIN7) {
+	if (par->synthvid_version = SYNTHVID_VERSION_WIN7)
 		screen_depth = SYNTHVID_DEPTH_WIN7;
-		screen_fb_size = SYNTHVID_FB_SIZE_WIN7;
-	} else {
+	else
 		screen_depth = SYNTHVID_DEPTH_WIN8;
-		screen_fb_size = SYNTHVID_FB_SIZE_WIN8;
-	}
+
+	screen_fb_size = hdev->channel->offermsg.offer.
+				mmio_megabytes * 1024 * 1024;
 
 	return 0;
 
@@ -635,22 +636,33 @@ static void hvfb_get_option(struct fb_info *info)
 /* Get framebuffer memory from Hyper-V video pci space */
 static int hvfb_getmem(struct fb_info *info)
 {
-	struct pci_dev *pdev;
+	struct pci_dev *pdev  = NULL;
 	ulong fb_phys;
 	void __iomem *fb_virt;
+	bool gen2vm = efi_enabled(EFI_BOOT);
 
-	pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
+	if (gen2vm) {
+		if (!hyperv_mmio_start || hyperv_mmio_size < screen_fb_size) {
+			pr_err("Unable to find ACPI MMIO area\n");
+			return -ENODEV;
+		}
+
+		fb_phys = hyperv_mmio_start;
+	} else {
+		pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
 			      PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
-	if (!pdev) {
-		pr_err("Unable to find PCI Hyper-V video\n");
-		return -ENODEV;
-	}
+		if (!pdev) {
+			pr_err("Unable to find PCI Hyper-V video\n");
+			return -ENODEV;
+		}
 
-	if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) ||
-	    pci_resource_len(pdev, 0) < screen_fb_size)
-		goto err1;
+		if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) ||
+		    pci_resource_len(pdev, 0) < screen_fb_size)
+			goto err1;
+
+		fb_phys = pci_resource_end(pdev, 0) - screen_fb_size + 1;
+	}
 
-	fb_phys = pci_resource_end(pdev, 0) - screen_fb_size + 1;
 	if (!request_mem_region(fb_phys, screen_fb_size, KBUILD_MODNAME))
 		goto err1;
 
@@ -662,14 +674,22 @@ static int hvfb_getmem(struct fb_info *info)
 	if (!info->apertures)
 		goto err3;
 
-	info->apertures->ranges[0].base = pci_resource_start(pdev, 0);
-	info->apertures->ranges[0].size = pci_resource_len(pdev, 0);
+	if (gen2vm) {
+		info->apertures->ranges[0].base = screen_info.lfb_base;
+		info->apertures->ranges[0].size = screen_info.lfb_size;
+	} else {
+		info->apertures->ranges[0].base = pci_resource_start(pdev, 0);
+		info->apertures->ranges[0].size = pci_resource_len(pdev, 0);
+	}
+
 	info->fix.smem_start = fb_phys;
 	info->fix.smem_len = screen_fb_size;
 	info->screen_base = fb_virt;
 	info->screen_size = screen_fb_size;
 
-	pci_dev_put(pdev);
+	if (!gen2vm)
+		pci_dev_put(pdev);
+
 	return 0;
 
 err3:
@@ -677,7 +697,9 @@ err3:
 err2:
 	release_mem_region(fb_phys, screen_fb_size);
 err1:
-	pci_dev_put(pdev);
+	if (!gen2vm)
+		pci_dev_put(pdev);
+
 	return -ENOMEM;
 }
 
-- 
1.7.4.1


^ permalink raw reply related

* Re: [v2] backlight: Convert from Legacy pm ops to dev_pm_ops
From: sebastian.capella @ 2014-02-18 22:20 UTC (permalink / raw)
  To: tomi.valkeinen, shuah.kh, rpurdie, rafael.j.wysocki, plagnioj,
	FlorianSchandinat
  Cc: shuahkhan, linux-kernel, linux-fbdev
In-Reply-To: <2236505237-3336-1-git-send-email-shuah.kh@samsung.com>

Shuah Khan <shuah.kh@samsung.com> wrote:

> Convert drivers/video/backlight/class to use dev_pm_ops for power
> management and remove Legacy PM ops hooks. With this change, rtc class
> registers suspend/resume callbacks via class->pm (dev_pm_ops) instead of
> Legacy class->suspend/resume. When __device_suspend() runs call-backs,
> it will find class->pm ops for the backlight class.
>
> Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
> Cc: Shuah Khan <shuahkhan@gmail.com>
>
> ---
> v2: Updated changelog to correct device class.
>
>  drivers/video/backlight/backlight.c |    8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
> index c74e7aa..0ffb251 100644
> --- a/drivers/video/backlight/backlight.c
> +++ b/drivers/video/backlight/backlight.c
> @@ -208,7 +208,7 @@ static ssize_t backlight_show_actual_brightness(struct device *dev,
>  
>  static struct class *backlight_class;
>  
> -static int backlight_suspend(struct device *dev, pm_message_t state)
> +static int backlight_suspend(struct device *dev)
>  {
>  	struct backlight_device *bd = to_backlight_device(dev);
>  
> @@ -236,6 +236,9 @@ static int backlight_resume(struct device *dev)
>  	return 0;
>  }
>  
> +static SIMPLE_DEV_PM_OPS(backlight_class_dev_pm_ops, backlight_suspend,
> +			 backlight_resume);
> +
>  static void bl_device_release(struct device *dev)
>  {
>  	struct backlight_device *bd = to_backlight_device(dev);
> @@ -414,8 +417,7 @@ static int __init backlight_class_init(void)
>  	}
>  
>  	backlight_class->dev_attrs = bl_device_attributes;
> -	backlight_class->suspend = backlight_suspend;
> -	backlight_class->resume = backlight_resume;
> +	backlight_class->pm = &backlight_class_dev_pm_ops;
>  	return 0;
>  }
>  

^ permalink raw reply

* [PATCH v2,0/2] Re-sending two patches for hyperv_fb
From: Haiyang Zhang @ 2014-02-21  4:58 UTC (permalink / raw)
  To: plagnioj, tomi.valkeinen, akpm, linux-fbdev
  Cc: olaf, jasowang, driverdev-devel, linux-kernel, haiyangz

They were sent out during tree closing, I'm re-sending them now.
---
v2: 
  Updated the variable type gen2vm to int, because efi_enabled() returns int.

Haiyang Zhang (2):
  hyperv_fb: Add screen refresh after pause/resume operation
  hyperv_fb: Add support for Gen2 VM

 drivers/video/hyperv_fb.c |   70 ++++++++++++++++++++++++++++++++-------------
 1 files changed, 50 insertions(+), 20 deletions(-)

-- 
1.7.4.1


^ permalink raw reply

* [PATCH v2,1/2] hyperv_fb: Add screen refresh after pause/resume operation
From: Haiyang Zhang @ 2014-02-21  4:59 UTC (permalink / raw)
  To: plagnioj, tomi.valkeinen, akpm, linux-fbdev
  Cc: olaf, jasowang, driverdev-devel, linux-kernel, haiyangz
In-Reply-To: <1392961811-11960-1-git-send-email-haiyangz@microsoft.com>

This is necessary because after VM is pause/resumed, some portion of
the screen may need refresh.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/video/hyperv_fb.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c
index 130708f..bbcc8c0 100644
--- a/drivers/video/hyperv_fb.c
+++ b/drivers/video/hyperv_fb.c
@@ -218,6 +218,7 @@ struct hvfb_par {
 
 	struct delayed_work dwork;
 	bool update;
+	bool xrefresh;
 
 	u32 pseudo_palette[16];
 	u8 init_buf[MAX_VMBUS_PKT_SIZE];
@@ -369,7 +370,7 @@ static void synthvid_recv_sub(struct hv_device *hdev)
 			synthvid_send_situ(hdev);
 		}
 
-		par->update = msg->feature_chg.is_dirt_needed;
+		par->xrefresh = par->update = msg->feature_chg.is_dirt_needed;
 		if (par->update)
 			schedule_delayed_work(&par->dwork, HVFB_UPDATE_DELAY);
 	}
@@ -522,6 +523,13 @@ static void hvfb_update_work(struct work_struct *w)
 {
 	struct hvfb_par *par = container_of(w, struct hvfb_par, dwork.work);
 	struct fb_info *info = par->info;
+	char *argv[] = {"/usr/bin/xrefresh", "-display", ":0.0", NULL};
+	char *envp[] = {"HOME=/", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
+
+	if (par->xrefresh) {
+		par->xrefresh = false;
+		call_usermodehelper(argv[0], argv, envp, UMH_NO_WAIT);
+	}
 
 	if (par->fb_ready)
 		synthvid_update(info);
-- 
1.7.4.1


^ permalink raw reply related

* [PATCH v2,2/2] hyperv_fb: Add support for Gen2 VM
From: Haiyang Zhang @ 2014-02-21  4:59 UTC (permalink / raw)
  To: plagnioj, tomi.valkeinen, akpm, linux-fbdev
  Cc: olaf, jasowang, driverdev-devel, linux-kernel, haiyangz
In-Reply-To: <1392961811-11960-1-git-send-email-haiyangz@microsoft.com>

This patch enables Hyper-V FB driver to run on Gen2 VM.

The Gen2 VM provides MMIO area for synthetic video from ACPI module,
which is exported by vmbus. The generic video is provided by UEFI. PCI
video in Gen1 is no longer available.

To support synthetic video on Hyper-V Gen2 VM, this patch updated
code related to the changes above.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/video/hyperv_fb.c |   60 ++++++++++++++++++++++++++++++--------------
 1 files changed, 41 insertions(+), 19 deletions(-)

diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c
index bbcc8c0..5db1f20 100644
--- a/drivers/video/hyperv_fb.c
+++ b/drivers/video/hyperv_fb.c
@@ -42,6 +42,7 @@
 #include <linux/completion.h>
 #include <linux/fb.h>
 #include <linux/pci.h>
+#include <linux/efi.h>
 
 #include <linux/hyperv.h>
 
@@ -461,13 +462,13 @@ static int synthvid_connect_vsp(struct hv_device *hdev)
 		goto error;
 	}
 
-	if (par->synthvid_version = SYNTHVID_VERSION_WIN7) {
+	if (par->synthvid_version = SYNTHVID_VERSION_WIN7)
 		screen_depth = SYNTHVID_DEPTH_WIN7;
-		screen_fb_size = SYNTHVID_FB_SIZE_WIN7;
-	} else {
+	else
 		screen_depth = SYNTHVID_DEPTH_WIN8;
-		screen_fb_size = SYNTHVID_FB_SIZE_WIN8;
-	}
+
+	screen_fb_size = hdev->channel->offermsg.offer.
+				mmio_megabytes * 1024 * 1024;
 
 	return 0;
 
@@ -635,22 +636,33 @@ static void hvfb_get_option(struct fb_info *info)
 /* Get framebuffer memory from Hyper-V video pci space */
 static int hvfb_getmem(struct fb_info *info)
 {
-	struct pci_dev *pdev;
+	struct pci_dev *pdev  = NULL;
 	ulong fb_phys;
 	void __iomem *fb_virt;
+	int gen2vm = efi_enabled(EFI_BOOT);
 
-	pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
+	if (gen2vm) {
+		if (!hyperv_mmio_start || hyperv_mmio_size < screen_fb_size) {
+			pr_err("Unable to find ACPI MMIO area\n");
+			return -ENODEV;
+		}
+
+		fb_phys = hyperv_mmio_start;
+	} else {
+		pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
 			      PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
-	if (!pdev) {
-		pr_err("Unable to find PCI Hyper-V video\n");
-		return -ENODEV;
-	}
+		if (!pdev) {
+			pr_err("Unable to find PCI Hyper-V video\n");
+			return -ENODEV;
+		}
 
-	if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) ||
-	    pci_resource_len(pdev, 0) < screen_fb_size)
-		goto err1;
+		if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) ||
+		    pci_resource_len(pdev, 0) < screen_fb_size)
+			goto err1;
+
+		fb_phys = pci_resource_end(pdev, 0) - screen_fb_size + 1;
+	}
 
-	fb_phys = pci_resource_end(pdev, 0) - screen_fb_size + 1;
 	if (!request_mem_region(fb_phys, screen_fb_size, KBUILD_MODNAME))
 		goto err1;
 
@@ -662,14 +674,22 @@ static int hvfb_getmem(struct fb_info *info)
 	if (!info->apertures)
 		goto err3;
 
-	info->apertures->ranges[0].base = pci_resource_start(pdev, 0);
-	info->apertures->ranges[0].size = pci_resource_len(pdev, 0);
+	if (gen2vm) {
+		info->apertures->ranges[0].base = screen_info.lfb_base;
+		info->apertures->ranges[0].size = screen_info.lfb_size;
+	} else {
+		info->apertures->ranges[0].base = pci_resource_start(pdev, 0);
+		info->apertures->ranges[0].size = pci_resource_len(pdev, 0);
+	}
+
 	info->fix.smem_start = fb_phys;
 	info->fix.smem_len = screen_fb_size;
 	info->screen_base = fb_virt;
 	info->screen_size = screen_fb_size;
 
-	pci_dev_put(pdev);
+	if (!gen2vm)
+		pci_dev_put(pdev);
+
 	return 0;
 
 err3:
@@ -677,7 +697,9 @@ err3:
 err2:
 	release_mem_region(fb_phys, screen_fb_size);
 err1:
-	pci_dev_put(pdev);
+	if (!gen2vm)
+		pci_dev_put(pdev);
+
 	return -ENOMEM;
 }
 
-- 
1.7.4.1


^ permalink raw reply related

* [PATCH] video: da8xx-fb: fix typos
From: Prabhakar Lad @ 2014-02-21  6:53 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: linux-kernel, linux-fbdev, linux-pm, Lad, Prabhakar

From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>

This patch fixes couple of typos in the comments
for da8xx-fb.c file.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
---
 drivers/video/da8xx-fb.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index a1d74dd..dced43a 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -265,7 +265,7 @@ static void lcd_enable_raster(void)
 		lcdc_write(0, LCD_CLK_RESET_REG);
 	mdelay(1);
 
-	/* Above reset sequence doesnot reset register context */
+	/* Above reset sequence does not reset register context */
 	reg = lcdc_read(LCD_RASTER_CTRL_REG);
 	if (!(reg & LCD_RASTER_ENABLE))
 		lcdc_write(reg | LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG);
@@ -357,7 +357,7 @@ static void lcd_blit(int load_mode, struct da8xx_fb_par *par)
 	lcd_enable_raster();
 }
 
-/* Configure the Burst Size and fifo threhold of DMA */
+/* Configure the Burst Size and fifo threshold of DMA */
 static int lcd_cfg_dma(int burst_size, int fifo_th)
 {
 	u32 reg;
@@ -393,7 +393,7 @@ static void lcd_cfg_ac_bias(int period, int transitions_per_int)
 {
 	u32 reg;
 
-	/* Set the AC Bias Period and Number of Transisitons per Interrupt */
+	/* Set the AC Bias Period and Number of Transitions per Interrupt */
 	reg = lcdc_read(LCD_RASTER_TIMING_2_REG) & 0xFFF00000;
 	reg |= LCD_AC_BIAS_FREQUENCY(period) |
 		LCD_AC_BIAS_TRANSITIONS_PER_INT(transitions_per_int);
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 0/4] hyperv-fb: add support for generation 2 virtual machines
From: Gerd Hoffmann @ 2014-02-21  8:56 UTC (permalink / raw)
  To: linux-fbdev; +Cc: linux-kernel, gregkh, kys, haiyangz, jasowang, Gerd Hoffmann

  Hi,

This patch series adds support for uefi-based gen2 virtual machines to
the hyperv-fb driver.

First patch is included just for completeness.  Greg picked it up
already and it is in -next, but it isn't in master yet.

Second patch is a bugfix for the first patch.

Third patch changes vmbus to properly hook the hyperv mmio area into
the linux resource management.

Final patch actually implements gen2 vm support for hyperv-fb, building
on the hyperv mmio support added by the other patches.

Known issue: There is a long delay when loading the hyperv-fb driver on
gen2 virtual machines which isn't present on gen1 virtual machines.

Gerd Hoffmann (3):
  vmbus: add missing breaks
  vmbus: use resource for hyperv mmio region
  hyperv-fb: add support for generation 2 virtual machines.

K. Y. Srinivasan (1):
  Drivers: hv: vmbus: Extract the mmio information from DSDT

 drivers/hv/vmbus_drv.c    | 51 +++++++++++++++++++++-------
 drivers/video/hyperv_fb.c | 86 +++++++++++++++++++++++++++++++++--------------
 include/linux/hyperv.h    |  2 ++
 3 files changed, 100 insertions(+), 39 deletions(-)

-- 
1.8.3.1


^ permalink raw reply

* [PATCH 1/4] Drivers: hv: vmbus: Extract the mmio information from DSDT
From: Gerd Hoffmann @ 2014-02-21  8:56 UTC (permalink / raw)
  To: linux-fbdev
  Cc: linux-kernel, gregkh, kys, haiyangz, jasowang,
	open list:Hyper-V CORE AND...
In-Reply-To: <1392973004-28215-1-git-send-email-kraxel@redhat.com>

From: "K. Y. Srinivasan" <kys@microsoft.com>

On Gen2 firmware, Hyper-V does not emulate the PCI bus. However, the MMIO
information is packaged up in DSDT. Extract this information and export it
for use by the synthetic framebuffer driver. This is the only driver that
needs this currently.

In this version of the patch mmio, I have updated the hyperv header file
(linux/hyperv.h) with mmio definitions.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/hv/vmbus_drv.c | 45 ++++++++++++++++++++++++++++++++-------------
 include/linux/hyperv.h |  3 +++
 2 files changed, 35 insertions(+), 13 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 077bb1b..b37c91b 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -43,6 +43,10 @@ static struct acpi_device  *hv_acpi_dev;
 static struct tasklet_struct msg_dpc;
 static struct completion probe_event;
 static int irq;
+u64 hyperv_mmio_start;
+EXPORT_SYMBOL_GPL(hyperv_mmio_start);
+u64 hyperv_mmio_size;
+EXPORT_SYMBOL_GPL(hyperv_mmio_size);
 
 static int vmbus_exists(void)
 {
@@ -886,18 +890,19 @@ void vmbus_device_unregister(struct hv_device *device_obj)
 
 
 /*
- * VMBUS is an acpi enumerated device. Get the the IRQ information
- * from DSDT.
+ * VMBUS is an acpi enumerated device. Get the the information we
+ * need from DSDT.
  */
 
-static acpi_status vmbus_walk_resources(struct acpi_resource *res, void *irq)
+static acpi_status vmbus_walk_resources(struct acpi_resource *res, void *ctx)
 {
+	switch (res->type) {
+	case ACPI_RESOURCE_TYPE_IRQ:
+		irq = res->data.irq.interrupts[0];
 
-	if (res->type = ACPI_RESOURCE_TYPE_IRQ) {
-		struct acpi_resource_irq *irqp;
-		irqp = &res->data.irq;
-
-		*((unsigned int *)irq) = irqp->interrupts[0];
+	case ACPI_RESOURCE_TYPE_ADDRESS64:
+		hyperv_mmio_start = res->data.address64.minimum;
+		hyperv_mmio_size = res->data.address64.address_length;
 	}
 
 	return AE_OK;
@@ -906,18 +911,32 @@ static acpi_status vmbus_walk_resources(struct acpi_resource *res, void *irq)
 static int vmbus_acpi_add(struct acpi_device *device)
 {
 	acpi_status result;
+	int ret_val = -ENODEV;
 
 	hv_acpi_dev = device;
 
 	result = acpi_walk_resources(device->handle, METHOD_NAME__CRS,
-					vmbus_walk_resources, &irq);
+					vmbus_walk_resources, NULL);
 
-	if (ACPI_FAILURE(result)) {
-		complete(&probe_event);
-		return -ENODEV;
+	if (ACPI_FAILURE(result))
+		goto acpi_walk_err;
+	/*
+	 * The parent of the vmbus acpi device (Gen2 firmware) is the VMOD that
+	 * has the mmio ranges. Get that.
+	 */
+	if (device->parent) {
+		result = acpi_walk_resources(device->parent->handle,
+					METHOD_NAME__CRS,
+					vmbus_walk_resources, NULL);
+
+		if (ACPI_FAILURE(result))
+			goto acpi_walk_err;
 	}
+	ret_val = 0;
+
+acpi_walk_err:
 	complete(&probe_event);
-	return 0;
+	return ret_val;
 }
 
 static const struct acpi_device_id vmbus_acpi_device_ids[] = {
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 344883d..be3028f 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -1459,6 +1459,9 @@ int hv_vss_init(struct hv_util_service *);
 void hv_vss_deinit(void);
 void hv_vss_onchannelcallback(void *);
 
+extern u64 hyperv_mmio_start;
+extern u64 hyperv_mmio_size;
+
 /*
  * Negotiated version with the Host.
  */
-- 
1.8.3.1


^ permalink raw reply related

* [PATCH 2/4] vmbus: add missing breaks
From: Gerd Hoffmann @ 2014-02-21  8:56 UTC (permalink / raw)
  To: linux-fbdev
  Cc: linux-kernel, gregkh, kys, haiyangz, jasowang, Gerd Hoffmann,
	open list:Hyper-V CORE AND...
In-Reply-To: <1392973004-28215-1-git-send-email-kraxel@redhat.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/hv/vmbus_drv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index b37c91b..2352ae48 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -899,10 +899,12 @@ static acpi_status vmbus_walk_resources(struct acpi_resource *res, void *ctx)
 	switch (res->type) {
 	case ACPI_RESOURCE_TYPE_IRQ:
 		irq = res->data.irq.interrupts[0];
+		break;
 
 	case ACPI_RESOURCE_TYPE_ADDRESS64:
 		hyperv_mmio_start = res->data.address64.minimum;
 		hyperv_mmio_size = res->data.address64.address_length;
+		break;
 	}
 
 	return AE_OK;
-- 
1.8.3.1


^ permalink raw reply related

* [PATCH 3/4] vmbus: use resource for hyperv mmio region
From: Gerd Hoffmann @ 2014-02-21  8:56 UTC (permalink / raw)
  To: linux-fbdev
  Cc: linux-kernel, gregkh, kys, haiyangz, jasowang, Gerd Hoffmann,
	open list:Hyper-V CORE AND...
In-Reply-To: <1392973004-28215-1-git-send-email-kraxel@redhat.com>

Use a resource for the hyperv mmio region instead of start/size
variables.  Register the region properly so it shows up in
/proc/iomem.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/hv/vmbus_drv.c | 16 ++++++++++------
 include/linux/hyperv.h |  3 +--
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 2352ae48..a14f603 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -43,10 +43,12 @@ static struct acpi_device  *hv_acpi_dev;
 static struct tasklet_struct msg_dpc;
 static struct completion probe_event;
 static int irq;
-u64 hyperv_mmio_start;
-EXPORT_SYMBOL_GPL(hyperv_mmio_start);
-u64 hyperv_mmio_size;
-EXPORT_SYMBOL_GPL(hyperv_mmio_size);
+
+struct resource hyperv_mmio = {
+	.name  = "hyperv mmio",
+	.flags = IORESOURCE_MEM,
+};
+EXPORT_SYMBOL_GPL(hyperv_mmio);
 
 static int vmbus_exists(void)
 {
@@ -902,8 +904,8 @@ static acpi_status vmbus_walk_resources(struct acpi_resource *res, void *ctx)
 		break;
 
 	case ACPI_RESOURCE_TYPE_ADDRESS64:
-		hyperv_mmio_start = res->data.address64.minimum;
-		hyperv_mmio_size = res->data.address64.address_length;
+		hyperv_mmio.start = res->data.address64.minimum;
+		hyperv_mmio.end = res->data.address64.maximum;
 		break;
 	}
 
@@ -933,6 +935,8 @@ static int vmbus_acpi_add(struct acpi_device *device)
 
 		if (ACPI_FAILURE(result))
 			goto acpi_walk_err;
+		if (hyperv_mmio.start && hyperv_mmio.end)
+			request_resource(&iomem_resource, &hyperv_mmio);
 	}
 	ret_val = 0;
 
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index be3028f..c93e342 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -1459,8 +1459,7 @@ int hv_vss_init(struct hv_util_service *);
 void hv_vss_deinit(void);
 void hv_vss_onchannelcallback(void *);
 
-extern u64 hyperv_mmio_start;
-extern u64 hyperv_mmio_size;
+extern struct resource hyperv_mmio;
 
 /*
  * Negotiated version with the Host.
-- 
1.8.3.1


^ permalink raw reply related

* [PATCH 4/4] hyperv-fb: add support for generation 2 virtual machines.
From: Gerd Hoffmann @ 2014-02-21  8:56 UTC (permalink / raw)
  To: linux-fbdev
  Cc: linux-kernel, gregkh, kys, haiyangz, jasowang, Gerd Hoffmann,
	Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	open list:Hyper-V CORE AND...
In-Reply-To: <1392973004-28215-1-git-send-email-kraxel@redhat.com>

UEFI-based generation 2 virtual machines support vmbus devices only.
There is no pci bus.  Thus they use a different mechanism for the
graphics framebuffer:  Instead of using the vga pci bar a chunk of
memory muct be allocated from the hyperv mmio region declared using
APCI.  This patch implements support for it.

Based on a patch by Haiyang Zhang <haiyangz@microsoft.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/video/hyperv_fb.c | 86 +++++++++++++++++++++++++++++++++--------------
 1 file changed, 60 insertions(+), 26 deletions(-)

diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c
index 130708f..f956cd9 100644
--- a/drivers/video/hyperv_fb.c
+++ b/drivers/video/hyperv_fb.c
@@ -42,6 +42,7 @@
 #include <linux/completion.h>
 #include <linux/fb.h>
 #include <linux/pci.h>
+#include <linux/efi.h>
 
 #include <linux/hyperv.h>
 
@@ -212,6 +213,7 @@ struct synthvid_msg {
 
 struct hvfb_par {
 	struct fb_info *info;
+	struct resource mem;
 	bool fb_ready; /* fb device is ready */
 	struct completion wait;
 	u32 synthvid_version;
@@ -460,13 +462,13 @@ static int synthvid_connect_vsp(struct hv_device *hdev)
 		goto error;
 	}
 
-	if (par->synthvid_version = SYNTHVID_VERSION_WIN7) {
+	if (par->synthvid_version = SYNTHVID_VERSION_WIN7)
 		screen_depth = SYNTHVID_DEPTH_WIN7;
-		screen_fb_size = SYNTHVID_FB_SIZE_WIN7;
-	} else {
+	else
 		screen_depth = SYNTHVID_DEPTH_WIN8;
-		screen_fb_size = SYNTHVID_FB_SIZE_WIN8;
-	}
+
+	screen_fb_size = hdev->channel->offermsg.offer.
+				mmio_megabytes * 1024 * 1024;
 
 	return 0;
 
@@ -627,26 +629,46 @@ static void hvfb_get_option(struct fb_info *info)
 /* Get framebuffer memory from Hyper-V video pci space */
 static int hvfb_getmem(struct fb_info *info)
 {
-	struct pci_dev *pdev;
-	ulong fb_phys;
+	struct hvfb_par *par = info->par;
+	struct pci_dev *pdev  = NULL;
 	void __iomem *fb_virt;
+	bool gen2vm = efi_enabled(EFI_BOOT);
+	int ret;
 
-	pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
+	par->mem.name = "hyperv_fb";
+	par->mem.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	if (gen2vm) {
+		ret = allocate_resource(&hyperv_mmio, &par->mem,
+					screen_fb_size,
+					0, -1,
+					screen_fb_size,
+					NULL, NULL);
+		if (ret != 0) {
+			pr_err("Unable to allocate framebuffer memory\n");
+			return -ENODEV;
+		}
+	} else {
+		pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
 			      PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
-	if (!pdev) {
-		pr_err("Unable to find PCI Hyper-V video\n");
-		return -ENODEV;
-	}
+		if (!pdev) {
+			pr_err("Unable to find PCI Hyper-V video\n");
+			return -ENODEV;
+		}
 
-	if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) ||
-	    pci_resource_len(pdev, 0) < screen_fb_size)
-		goto err1;
+		if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) ||
+		    pci_resource_len(pdev, 0) < screen_fb_size)
+			goto err1;
 
-	fb_phys = pci_resource_end(pdev, 0) - screen_fb_size + 1;
-	if (!request_mem_region(fb_phys, screen_fb_size, KBUILD_MODNAME))
-		goto err1;
+		par->mem.end = pci_resource_end(pdev, 0);
+		par->mem.start = par->mem.end - screen_fb_size + 1;
+		ret = request_resource(&pdev->resource[0], &par->mem);
+		if (ret != 0) {
+			pr_err("Unable to request framebuffer memory\n");
+			return -ENODEV;
+		}
+	}
 
-	fb_virt = ioremap(fb_phys, screen_fb_size);
+	fb_virt = ioremap(par->mem.start, screen_fb_size);
 	if (!fb_virt)
 		goto err2;
 
@@ -654,30 +676,42 @@ static int hvfb_getmem(struct fb_info *info)
 	if (!info->apertures)
 		goto err3;
 
-	info->apertures->ranges[0].base = pci_resource_start(pdev, 0);
-	info->apertures->ranges[0].size = pci_resource_len(pdev, 0);
-	info->fix.smem_start = fb_phys;
+	if (gen2vm) {
+		info->apertures->ranges[0].base = screen_info.lfb_base;
+		info->apertures->ranges[0].size = screen_info.lfb_size;
+	} else {
+		info->apertures->ranges[0].base = pci_resource_start(pdev, 0);
+		info->apertures->ranges[0].size = pci_resource_len(pdev, 0);
+	}
+
+	info->fix.smem_start = par->mem.start;
 	info->fix.smem_len = screen_fb_size;
 	info->screen_base = fb_virt;
 	info->screen_size = screen_fb_size;
 
-	pci_dev_put(pdev);
+	if (!gen2vm)
+		pci_dev_put(pdev);
+
 	return 0;
 
 err3:
 	iounmap(fb_virt);
 err2:
-	release_mem_region(fb_phys, screen_fb_size);
+	release_resource(&par->mem);
 err1:
-	pci_dev_put(pdev);
+	if (!gen2vm)
+		pci_dev_put(pdev);
+
 	return -ENOMEM;
 }
 
 /* Release the framebuffer */
 static void hvfb_putmem(struct fb_info *info)
 {
+	struct hvfb_par *par = info->par;
+
 	iounmap(info->screen_base);
-	release_mem_region(info->fix.smem_start, screen_fb_size);
+	release_resource(&par->mem);
 }
 
 
-- 
1.8.3.1


^ permalink raw reply related

* Re: [PATCH 00/11] SimpleDRM & Sysfb
From: Thierry Reding @ 2014-02-21  9:56 UTC (permalink / raw)
  To: David Herrmann
  Cc: linux-fbdev@vger.kernel.org, Daniel Vetter, linux-kernel,
	dri-devel@lists.freedesktop.org, Tomi Valkeinen, Ingo Molnar
In-Reply-To: <CANq1E4S=+ixMQRMfX2-DXh3ZDO0jNAdWrUe6=z9aTdOSfR-SDA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1908 bytes --]

On Mon, Jan 27, 2014 at 11:18:51PM +0100, David Herrmann wrote:
> Hi
> 
> On Thu, Jan 23, 2014 at 3:14 PM, David Herrmann <dh.herrmann@gmail.com> wrote:
> > Hi
> >
> > Another round of SimpleDRM patches. I somehow lost track of the last ones and as
> > this is a major rewrite, I'll just start at v1 again.
> >
> > Some comments up-front:
> >
> >  - @Ingo: Patch #1 and #2 are unchanged from the previous ML discussions. I
> >    included them in this series as the other patches depend on them. Could you
> >    pick them up for the x86 tree? The other 9 patches won't make it in 3.14 so
> >    no reason to put them through the DRM tree.
> >    All mentioned issues should be addressed. If there's still sth missing,
> >    please let me know.
> >
> >  - The DRM patches depend on my "DRM Anonymous Inode" patches. But it should be
> >    trivial to apply them on drm-next (I think only one line needs to be changed:
> >    i_mapping => dev_mapping).
> >
> >  - I tested the SimpleDRM fbdev fallback with linux-console+Xorg and it works
> >    fine. The DRM backend is only tested with some DRM tests I have locally. I
> >    have no idea how to make Xorg pick up a specific /dev/dri/card0 card. It
> >    always tells me "no screens found" (as the underlying device is not marked as
> >    boot_vga..). If someone knows how to tell Xorg to use card0, I'd gladly test
> >    this. But I'm no longer used to writing xorg.confs..
> 
> For completeness, I tested this with Xorg+xf86-video-modesetting and
> it works just fine. The xorg.conf I used can be found below. If this
> driver gets upstreamed, I will try to make the X11 auto-loader detect
> it just like any other platform-device.

I recently posted patches[0] to the xorg-devel mailing list that I think
should solve that issue.

Thierry

[0]: http://lists.x.org/archives/xorg-devel/2014-February/040568.html

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH Resend] video: exynos: Remove OF dependency for Exynos DP
From: Sachin Kamat @ 2014-02-21 10:52 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1392194002-6670-1-git-send-email-sachin.kamat@linaro.org>

On 12 February 2014 14:03, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> OF dependency can be removed as the driver does not actually
> depend on it at all.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Acked-by: Jingoo Han <jg1.han@samsung.com>
> ---
>  drivers/video/exynos/Kconfig |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/exynos/Kconfig b/drivers/video/exynos/Kconfig
> index 1129d0e9e640..976594d578a9 100644
> --- a/drivers/video/exynos/Kconfig
> +++ b/drivers/video/exynos/Kconfig
> @@ -30,7 +30,7 @@ config EXYNOS_LCD_S6E8AX0
>
>  config EXYNOS_DP
>         bool "EXYNOS DP driver support"
> -       depends on OF && ARCH_EXYNOS
> +       depends on ARCH_EXYNOS
>         default n
>         help
>           This enables support for DP device.
> --
> 1.7.9.5
>

Gentle ping, Tomi.

-- 
With warm regards,
Sachin

^ permalink raw reply

* [!! SPAM]Foreign Stakeholder Needed!!!
From: Yung kyu kim @ 2014-02-21 13:08 UTC (permalink / raw)
  To: linux-fbdev




Hello,

The Project is about the exportation of 100,000 barrels of Light Crude
Oil daily out from Iraq to Turkey through my client's company in Iraq
at the rate of $92.00 per barrel. This amount to $9,200,000 daily. I ask
for your support as a foreigner to handle this business project with my
client and you are not expected to invest in Iraq

If yes, let me know and we will discuss this project proper.

Kim.
Contact My Private Email : 1469813849@qq.com

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox