Subversion Repositories Kolibri OS

Rev

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

Rev 3120 Rev 3124
Line 703... Line 703...
703
#include "clip.inc"
703
#include "clip.inc"
704
#include "r100d.h"
704
#include "r100d.h"
Line 705... Line 705...
705
 
705
 
706
# define PACKET3_BITBLT            0x92
-
 
-
 
706
# define PACKET3_BITBLT            0x92
-
 
707
# define PACKET3_TRANS_BITBLT           0x9C
-
 
708
# define R5XX_SRC_CMP_EQ_COLOR      (4 <<  0)
-
 
709
# define R5XX_SRC_CMP_NEQ_COLOR     (5 <<  0)
Line 707... Line 710...
707
 
710
# define R5XX_CLR_CMP_SRC_SOURCE    (1 << 24)
708
 
711
 
709
int srv_blit_bitmap(u32 hbitmap, int  dst_x, int dst_y,
712
int srv_blit_bitmap(u32 hbitmap, int  dst_x, int dst_y,
710
               int src_x, int src_y, u32 w, u32 h)
713
               int src_x, int src_y, u32 w, u32 h)
Line 775... Line 778...
775
 
778
 
Line 776... Line 779...
776
    slot_mask = (u32_t)slot<<24;
779
    slot_mask = (u32_t)slot<<24;
Line 777... Line 780...
777
 
780
 
778
    {
781
    {
779
#if 1
782
#if 0
780
#else
783
#else
781
        u8* src_offset;
784
        u8* src_offset;
-
 
785
        u8* dst_offset;
-
 
786
        u32 color;
782
        u8* dst_offset;
787
 
Line 783... Line 788...
783
        u32 ifl;
788
        u32 ifl;
784
 
789
 
Line 792... Line 797...
792
 
797
 
Line 793... Line 798...
793
      ifl = safe_cli();
798
      ifl = safe_cli();
794
        while( tmp_h--)
799
        while( tmp_h--)
795
        {
800
        {
796
            u32_t tmp_w = width;
801
            u32 tmp_w = width;
Line 797... Line 802...
797
 
802
 
798
            u8* tmp_src = src_offset;
803
            u32* tmp_src = src_offset;
Line 799... Line 804...
799
            u8* tmp_dst = dst_offset;
804
            u8* tmp_dst = dst_offset;
800
 
805
 
Line 801... Line 806...
801
            src_offset+= bitmap->pitch;
806
            src_offset+= bitmap->pitch;
802
            dst_offset+= rdisplay->width;
807
            dst_offset+= rdisplay->width;
-
 
808
 
-
 
809
            while( tmp_w--)
803
 
810
            {
-
 
811
                color = *tmp_src;
-
 
812
 
-
 
813
                if(*tmp_dst == slot)
-
 
814
                    color |= 0xFF000000;
-
 
815
                else
804
            while( tmp_w--)
816
                    color = 0x00;
805
            {
817
 
806
                *(tmp_src+3) = (*tmp_dst==slot)?0xFF:0x00;
818
                *tmp_src = color;
807
                tmp_src+=4;
819
                tmp_src++;
808
                tmp_dst++;
820
                tmp_dst++;
809
            };
821
            };
Line 836... Line 848...
836
 
848
 
Line 837... Line 849...
837
    struct radeon_device *rdev = main_drm_device->dev_private;
849
    struct radeon_device *rdev = main_drm_device->dev_private;
838
    struct radeon_ib *ib = &context->ib;
850
    struct radeon_ib *ib = &context->ib;
Line -... Line 851...
-
 
851
 
-
 
852
    ib->ptr[0] = PACKET0(0x15cc, 0);
839
 
853
    ib->ptr[1] = 0xFFFFFFFF;
840
    ib->ptr[0] = PACKET3(PACKET3_BITBLT, 8);
854
    ib->ptr[2] = PACKET3(PACKET3_TRANS_BITBLT, 11);
841
    ib->ptr[1] =  RADEON_GMC_SRC_PITCH_OFFSET_CNTL |
855
    ib->ptr[3] =  RADEON_GMC_SRC_PITCH_OFFSET_CNTL |
842
                  RADEON_GMC_DST_PITCH_OFFSET_CNTL |
856
                  RADEON_GMC_DST_PITCH_OFFSET_CNTL |
843
                  RADEON_GMC_SRC_CLIPPING |
857
                  RADEON_GMC_SRC_CLIPPING |
844
                  RADEON_GMC_DST_CLIPPING |
858
                  RADEON_GMC_DST_CLIPPING |
845
                  RADEON_GMC_BRUSH_NONE |
859
                  RADEON_GMC_BRUSH_NONE |
846
                  (RADEON_COLOR_FORMAT_ARGB8888 << 8) |
860
                  (RADEON_COLOR_FORMAT_ARGB8888 << 8) |
847
                  RADEON_GMC_SRC_DATATYPE_COLOR |
861
                  RADEON_GMC_SRC_DATATYPE_COLOR |
848
                  RADEON_ROP3_S |
862
                  RADEON_ROP3_S |
849
                  RADEON_DP_SRC_SOURCE_MEMORY |
-
 
850
                  RADEON_GMC_CLR_CMP_CNTL_DIS |
863
                  RADEON_DP_SRC_SOURCE_MEMORY |
Line 851... Line 864...
851
                  RADEON_GMC_WR_MSK_DIS;
864
                  RADEON_GMC_WR_MSK_DIS;
852
 
865
 
853
    ib->ptr[2] = ((bitmap->pitch/64) << 22) | (bitmap->gaddr >> 10);
-
 
854
    ib->ptr[3] = ((rdisplay->pitch/64) << 22) | (rdev->mc.vram_start >> 10);
-
 
855
    ib->ptr[4] = (0x1fff) | (0x1fff << 16);
866
    ib->ptr[4] = ((bitmap->pitch/64) << 22) | (bitmap->gaddr >> 10);
-
 
867
    ib->ptr[5] = ((rdisplay->pitch/64) << 22) | (rdev->mc.vram_start >> 10);
-
 
868
    ib->ptr[6] = (0x1fff) | (0x1fff << 16);
-
 
869
    ib->ptr[7] = 0;
-
 
870
    ib->ptr[8] = (0x1fff) | (0x1fff << 16);
-
 
871
 
-
 
872
    ib->ptr[9] = R5XX_CLR_CMP_SRC_SOURCE | R5XX_SRC_CMP_EQ_COLOR;
-
 
873
    ib->ptr[10] = 0x00000000;
-
 
874
    ib->ptr[11] = 0xFFFFFFFF;
-
 
875
 
-
 
876
    ib->ptr[12] = (src_x << 16) | src_y;
Line 856... Line -...
856
    ib->ptr[5] = 0;
-
 
857
    ib->ptr[6] = (0x1fff) | (0x1fff << 16);
-
 
858
 
-
 
859
    ib->ptr[7] = (src_x << 16) | src_y;
-
 
860
    ib->ptr[8] = (dst_x << 16) | dst_y;
-
 
861
    ib->ptr[9] = (width << 16) | height;
-
 
862
 
-
 
863
    ib->ptr[10] = PACKET2(0);
-
 
864
    ib->ptr[11] = PACKET2(0);
-
 
865
    ib->ptr[12] = PACKET2(0);
877
    ib->ptr[13] = (dst_x << 16) | dst_y;
Line 866... Line 878...
866
    ib->ptr[13] = PACKET2(0);
878
    ib->ptr[14] = (width << 16) | height;
Line 867... Line 879...
867
    ib->ptr[14] = PACKET2(0);
879