forked from KolibriOS/kolibrios
86 lines
2.5 KiB
C
86 lines
2.5 KiB
C
|
/*
|
||
|
* Copyright © 2007 David Airlie
|
||
|
*
|
||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||
|
* copy of this software and associated documentation files (the "Software"),
|
||
|
* to deal in the Software without restriction, including without limitation
|
||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||
|
* Software is furnished to do so, subject to the following conditions:
|
||
|
*
|
||
|
* The above copyright notice and this permission notice (including the next
|
||
|
* paragraph) shall be included in all copies or substantial portions of the
|
||
|
* Software.
|
||
|
*
|
||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||
|
* DEALINGS IN THE SOFTWARE.
|
||
|
*
|
||
|
* Authors:
|
||
|
* David Airlie
|
||
|
*/
|
||
|
|
||
|
#include <linux/module.h>
|
||
|
#include <linux/kernel.h>
|
||
|
#include <linux/errno.h>
|
||
|
#include <linux/string.h>
|
||
|
//#include <linux/mm.h>
|
||
|
//#include <linux/tty.h>
|
||
|
#include <linux/sysrq.h>
|
||
|
//#include <linux/delay.h>
|
||
|
#include <linux/fb.h>
|
||
|
//#include <linux/init.h>
|
||
|
//#include <linux/vga_switcheroo.h>
|
||
|
|
||
|
#include "drmP.h"
|
||
|
#include "drm.h"
|
||
|
#include "drm_crtc.h"
|
||
|
#include "drm_fb_helper.h"
|
||
|
#include "intel_drv.h"
|
||
|
#include "i915_drm.h"
|
||
|
#include "i915_drv.h"
|
||
|
|
||
|
|
||
|
static struct drm_fb_helper_funcs intel_fb_helper_funcs = {
|
||
|
.gamma_set = intel_crtc_fb_gamma_set,
|
||
|
.gamma_get = intel_crtc_fb_gamma_get,
|
||
|
// .fb_probe = intel_fb_find_or_create_single,
|
||
|
};
|
||
|
|
||
|
|
||
|
int intel_fbdev_init(struct drm_device *dev)
|
||
|
{
|
||
|
struct intel_fbdev *ifbdev;
|
||
|
drm_i915_private_t *dev_priv = dev->dev_private;
|
||
|
int ret;
|
||
|
|
||
|
ENTER();
|
||
|
|
||
|
ifbdev = kzalloc(sizeof(struct intel_fbdev), GFP_KERNEL);
|
||
|
if (!ifbdev)
|
||
|
return -ENOMEM;
|
||
|
|
||
|
dev_priv->fbdev = ifbdev;
|
||
|
ifbdev->helper.funcs = &intel_fb_helper_funcs;
|
||
|
|
||
|
ret = drm_fb_helper_init(dev, &ifbdev->helper,
|
||
|
dev_priv->num_pipe,
|
||
|
INTELFB_CONN_LIMIT);
|
||
|
if (ret) {
|
||
|
kfree(ifbdev);
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
drm_fb_helper_single_add_all_connectors(&ifbdev->helper);
|
||
|
drm_fb_helper_initial_config(&ifbdev->helper, 32);
|
||
|
|
||
|
LEAVE();
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
|