Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright © 2007 David Airlie
  3.  *
  4.  * Permission is hereby granted, free of charge, to any person obtaining a
  5.  * copy of this software and associated documentation files (the "Software"),
  6.  * to deal in the Software without restriction, including without limitation
  7.  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8.  * and/or sell copies of the Software, and to permit persons to whom the
  9.  * Software is furnished to do so, subject to the following conditions:
  10.  *
  11.  * The above copyright notice and this permission notice (including the next
  12.  * paragraph) shall be included in all copies or substantial portions of the
  13.  * Software.
  14.  *
  15.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  18.  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19.  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20.  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  21.  * DEALINGS IN THE SOFTWARE.
  22.  *
  23.  * Authors:
  24.  *     David Airlie
  25.  */
  26.  
  27. #include <linux/module.h>
  28. #include <linux/kernel.h>
  29. #include <linux/errno.h>
  30. #include <linux/string.h>
  31. //#include <linux/mm.h>
  32. //#include <linux/tty.h>
  33. #include <linux/sysrq.h>
  34. //#include <linux/delay.h>
  35. #include <linux/fb.h>
  36. //#include <linux/init.h>
  37. //#include <linux/vga_switcheroo.h>
  38.  
  39. #include "drmP.h"
  40. #include "drm.h"
  41. #include "drm_crtc.h"
  42. #include "drm_fb_helper.h"
  43. #include "intel_drv.h"
  44. #include "i915_drm.h"
  45. #include "i915_drv.h"
  46.  
  47.  
  48. static struct drm_fb_helper_funcs intel_fb_helper_funcs = {
  49.         .gamma_set = intel_crtc_fb_gamma_set,
  50.         .gamma_get = intel_crtc_fb_gamma_get,
  51. //   .fb_probe = intel_fb_find_or_create_single,
  52. };
  53.  
  54.  
  55. int intel_fbdev_init(struct drm_device *dev)
  56. {
  57.         struct intel_fbdev *ifbdev;
  58.         drm_i915_private_t *dev_priv = dev->dev_private;
  59.         int ret;
  60.  
  61.     ENTER();
  62.  
  63.         ifbdev = kzalloc(sizeof(struct intel_fbdev), GFP_KERNEL);
  64.         if (!ifbdev)
  65.                 return -ENOMEM;
  66.  
  67.         dev_priv->fbdev = ifbdev;
  68.         ifbdev->helper.funcs = &intel_fb_helper_funcs;
  69.  
  70.         ret = drm_fb_helper_init(dev, &ifbdev->helper,
  71.                                  dev_priv->num_pipe,
  72.                                  INTELFB_CONN_LIMIT);
  73.         if (ret) {
  74.                 kfree(ifbdev);
  75.                 return ret;
  76.         }
  77.  
  78.         drm_fb_helper_single_add_all_connectors(&ifbdev->helper);
  79.         drm_fb_helper_initial_config(&ifbdev->helper, 32);
  80.  
  81.     LEAVE();
  82.         return 0;
  83. }
  84.  
  85.  
  86.