Subversion Repositories Kolibri OS

Rev

Rev 5060 | Rev 5367 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5060 Rev 5354
Line 3... Line 3...
3
#include 
3
#include 
4
#include 
4
#include 
5
#include "i915_drv.h"
5
#include "i915_drv.h"
6
#include "intel_drv.h"
6
#include "intel_drv.h"
7
#include 
-
 
8
#include 
7
#include 
9
#include 
8
#include 
10
#include 
-
 
11
#include 
9
#include 
Line 12... Line 10...
12
 
10
 
Line 13... Line 11...
13
#include 
11
#include 
-
 
12
 
Line 14... Line -...
14
 
-
 
15
#include "bitmap.h"
-
 
16
 
-
 
17
typedef struct
-
 
18
{
-
 
19
    kobj_t     header;
-
 
20
 
-
 
21
    uint32_t  *data;
-
 
22
    uint32_t   hot_x;
-
 
23
    uint32_t   hot_y;
-
 
24
 
-
 
25
    struct list_head   list;
-
 
26
    struct drm_i915_gem_object  *cobj;
-
 
27
}cursor_t;
-
 
28
 
-
 
29
#define KMS_CURSOR_WIDTH 64
-
 
30
#define KMS_CURSOR_HEIGHT 64
-
 
31
 
-
 
32
 
-
 
33
struct tag_display
-
 
34
{
-
 
35
    int  x;
-
 
36
    int  y;
-
 
37
    int  width;
-
 
38
    int  height;
-
 
39
    int  bpp;
-
 
40
    int  vrefresh;
-
 
41
    int  pitch;
-
 
42
    int  lfb;
-
 
43
 
-
 
44
    int  supported_modes;
-
 
45
    struct drm_device    *ddev;
-
 
46
    struct drm_connector *connector;
-
 
47
    struct drm_crtc      *crtc;
-
 
48
 
-
 
49
    struct list_head   cursors;
-
 
50
 
-
 
51
    cursor_t   *cursor;
-
 
52
    int       (*init_cursor)(cursor_t*);
-
 
53
    cursor_t* (__stdcall *select_cursor)(cursor_t*);
-
 
54
    void      (*show_cursor)(int show);
-
 
55
    void      (__stdcall *move_cursor)(cursor_t *cursor, int x, int y);
-
 
56
    void      (__stdcall *restore_cursor)(int x, int y);
-
 
57
    void      (*disable_mouse)(void);
-
 
58
    u32  mask_seqno;
-
 
Line 59... Line -...
59
    u32  check_mouse;
-
 
60
    u32  check_m_pixel;
13
#include "bitmap.h"
61
};
14
#include 
Line 62... Line 15...
62
 
15
 
63
 
16
 
Line 64... Line 17...
64
static display_t *os_display;
17
display_t *os_display;
65
struct drm_i915_gem_object *main_fb_obj;
18
struct drm_i915_gem_object *main_fb_obj;
Line 66... Line -...
66
 
-
 
67
u32_t cmd_buffer;
19
 
68
u32_t cmd_offset;
20
u32 cmd_buffer;
Line 69... Line 21...
69
 
21
u32 cmd_offset;
70
void init_render();
22
 
Line 328... Line 280...
328
    struct drm_crtc         *crtc = NULL;
280
    struct drm_crtc         *crtc = NULL;
329
    struct drm_framebuffer  *fb;
281
    struct drm_framebuffer  *fb;
330
 
282
 
Line 331... Line 283...
331
    cursor_t  *cursor;
283
    cursor_t  *cursor;
332
    u32_t      ifl;
284
    u32      ifl;
333
    int        ret;
285
    int        ret;
Line 334... Line 286...
334
 
286
 
Line 335... Line 287...
335
    mutex_lock(&dev->mode_config.mutex);
287
    mutex_lock(&dev->mode_config.mutex);
Line 482... Line 434...
482
};
434
};
483
 
435
 
Line 484... Line 436...
484
void __attribute__((regparm(1))) destroy_cursor(cursor_t *cursor)
436
void __attribute__((regparm(1))) destroy_cursor(cursor_t *cursor)
485
{
437
{
-
 
438
    struct drm_i915_gem_object *obj = cursor->cobj;
486
    list_del(&cursor->list);
439
    list_del(&cursor->list);
Line 487... Line 440...
487
 
440
 
Line 488... Line 441...
488
    i915_gem_object_ggtt_unpin(cursor->cobj);
441
    i915_gem_object_ggtt_unpin(cursor->cobj);
489
 
442
 
490
    mutex_lock(&main_device->struct_mutex);
443
    mutex_lock(&main_device->struct_mutex);
Line 491... Line 444...
491
    drm_gem_object_unreference(&cursor->cobj->base);
444
    drm_gem_object_unreference(&obj->base);
492
    mutex_unlock(&main_device->struct_mutex);
445
    mutex_unlock(&main_device->struct_mutex);
Line 643... Line 596...
643
 
596
 
Line 644... Line 597...
644
 
597
 
Line 645... Line -...
645
#define CURRENT_TASK             (0x80003000)
-
 
646
 
-
 
647
static u32_t get_display_map()
-
 
648
{
-
 
649
    u32_t   addr;
-
 
650
 
-
 
651
    addr = (u32_t)os_display;
-
 
652
    addr+= sizeof(display_t);            /*  shoot me  */
-
 
653
    return *(u32_t*)addr;
-
 
654
}
598
#define CURRENT_TASK             (0x80003000)
Line 655... Line 599...
655
 
599
 
656
void  FASTCALL GetWindowRect(rect_t *rc)__asm__("GetWindowRect");
600
void  FASTCALL GetWindowRect(rect_t *rc)__asm__("GetWindowRect");
657
 
601
 
Line 717... Line 661...
717
//        printf("width %d height %d\n", winrc.right, winrc.bottom);
661
//        printf("width %d height %d\n", winrc.right, winrc.bottom);
Line 718... Line 662...
718
 
662
 
Line -... Line 663...
-
 
663
//        slot = 0x01;
-
 
664
 
Line 719... Line -...
719
//        slot = 0x01;
-
 
720
 
-
 
721
 
665
        src_offset = os_display->win_map;
Line 722... Line 666...
722
        src_offset = (u8*)( winrc.top*os_display->width + winrc.left);
666
        src_offset+= winrc.top*os_display->width + winrc.left;
Line 723... Line 667...
723
        src_offset+= get_display_map();
667
 
724
        dst_offset = (u8*)mask->bo_map;
668
        dst_offset = (u8*)mask->bo_map;
725
 
669
 
Line 924... Line 868...
924
            goto err1;
868
            goto err1;
925
 
869
 
Line 926... Line 870...
926
        i915_gem_object_set_to_cpu_domain(to_intel_bo(obj), true);
870
        i915_gem_object_set_to_cpu_domain(to_intel_bo(obj), true);
Line 927... Line 871...
927
 
871
 
928
        src_offset = (u8*)( mt*os_display->width + ml);
872
        src_offset = os_display->win_map;
929
        src_offset+= get_display_map();
873
        src_offset+= mt*os_display->width + ml;
Line 930... Line 874...
930
        dst_offset = (u8*)mask->bo_map;
874
        dst_offset = (u8*)mask->bo_map;
Line 931... Line 875...
931
 
875
 
932
        u32_t tmp_h = mask->height;
876
        u32 tmp_h = mask->height;
933
 
877
 
Line 1143... Line 1087...
1143
    list_del_init(&wait->task_list);
1087
    list_del_init(&wait->task_list);
1144
    return 1;
1088
    return 1;
1145
}
1089
}
1146
 
1090
 
Line 1147... Line -...
1147
unsigned int hweight16(unsigned int w)
-
 
1148
{
-
 
1149
    unsigned int res = w - ((w >> 1) & 0x5555);
-
 
1150
    res = (res & 0x3333) + ((res >> 2) & 0x3333);
-
 
1151
    res = (res + (res >> 4)) & 0x0F0F;
-
 
1152
    return (res + (res >> 8)) & 0x00FF;
-
 
1153
}
-
 
1154
 
-
 
1155
 
-
 
1156
unsigned long round_jiffies_up_relative(unsigned long j)
-
 
1157
{
-
 
1158
    unsigned long j0 = GetTimerTicks();
-
 
1159
 
-
 
1160
        /* Use j0 because jiffies might change while we run */
-
 
1161
    return round_jiffies_common(j + j0, true) - j0;
-
 
1162
}
-