Subversion Repositories Kolibri OS

Rev

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

Rev 2007 Rev 2160
Line 481... Line 481...
481
	int i, r, dwords;
481
	int i, r, dwords;
482
	void *ptr;
482
	void *ptr;
483
	u32 packet2s[16];
483
	u32 packet2s[16];
484
	int num_packet2s = 0;
484
	int num_packet2s = 0;
Line 485... Line -...
485
 
-
 
486
    ENTER();
-
 
487
 
485
 
488
	/* pin copy shader into vram if already initialized */
486
	/* pin copy shader into vram if already initialized */
489
	if (rdev->r600_blit.shader_obj)
487
	if (rdev->r600_blit.shader_obj)
Line 490... Line 488...
490
		goto done;
488
		goto done;
Line 560... Line 558...
560
		dev_err(rdev->dev, "(%d) pin blit object failed\n", r);
558
		dev_err(rdev->dev, "(%d) pin blit object failed\n", r);
561
		return r;
559
		return r;
562
	}
560
	}
563
//   radeon_ttm_set_active_vram_size(rdev, rdev->mc.real_vram_size);
561
//   radeon_ttm_set_active_vram_size(rdev, rdev->mc.real_vram_size);
Line 564... Line -...
564
 
-
 
Line 565... Line 562...
565
    LEAVE();
562
 
566
 
563
 
Line 567... Line 564...
567
	return 0;
564
	return 0;
Line 848... Line 845...
848
            u64 src_gpu_addr, int dstx, int dsty, int w, int h, int pitch)
845
            u64 src_gpu_addr, int dstx, int dsty, int w, int h, int pitch)
849
{
846
{
850
    u64 vb_gpu_addr;
847
    u64 vb_gpu_addr;
851
    u32 *vb;
848
    u32 *vb;
Line 852... Line 849...
852
 
849
 
853
    DRM_DEBUG("emitting video copy\n");
850
//    DRM_DEBUG("emitting video copy\n");
Line 854... Line 851...
854
    vb = (u32 *)(rdev->r600_blit.vb_ib->ptr + rdev->r600_blit.vb_used);
851
    vb = (u32 *)(rdev->r600_blit.vb_ib->ptr + rdev->r600_blit.vb_used);
855
 
852
 
856
    if ((rdev->r600_blit.vb_used + 48) > rdev->r600_blit.vb_total) {
853
    if ((rdev->r600_blit.vb_used + 48) > rdev->r600_blit.vb_total) {
Line 907... Line 904...
907
extern struct radeon_device *main_device;
904
extern struct radeon_device *main_device;
Line 908... Line 905...
908
 
905
 
909
int r600_video_blit(uint64_t src_offset, int  x, int y,
906
int r600_video_blit(uint64_t src_offset, int  x, int y,
910
                    int w, int h, int pitch)
907
                    int w, int h, int pitch)
911
{
-
 
912
    int r;
908
{
-
 
909
    struct radeon_device *rdev = main_device;
-
 
910
    static struct radeon_fence *fence;
-
 
911
    unsigned long irq_flags;
-
 
912
 
-
 
913
    int r;
-
 
914
 
-
 
915
    if(fence == NULL)
-
 
916
    {
-
 
917
        r = radeon_fence_create(rdev, &fence);
-
 
918
        if (r) {
-
 
919
            printf("%s epic fail", __FUNCTION__);
-
 
920
            return r;
-
 
921
        }
-
 
922
    };
-
 
923
 
Line 913... Line 924...
913
    struct radeon_device *rdev = main_device;
924
    fence->evnt = CreateEvent(NULL, 0);
914
 
925
 
915
    mutex_lock(&rdev->r600_blit.mutex);
926
    mutex_lock(&rdev->r600_blit.mutex);
916
    rdev->r600_blit.vb_ib = NULL;
927
    rdev->r600_blit.vb_ib = NULL;
Line 920... Line 931...
920
//           radeon_ib_free(rdev, &rdev->r600_blit.vb_ib);
931
//           radeon_ib_free(rdev, &rdev->r600_blit.vb_ib);
921
        mutex_unlock(&rdev->r600_blit.mutex);
932
        mutex_unlock(&rdev->r600_blit.mutex);
922
        return r;
933
        return r;
923
    }
934
    }
Line 924... Line -...
924
 
-
 
925
 
935
 
926
    r600_kms_video_blit(rdev, src_offset,x,y,w,h,pitch);
936
    r600_kms_video_blit(rdev, src_offset,x,y,w,h,pitch);
927
    r600_blit_done_copy(rdev, NULL);
937
    r600_blit_done_copy(rdev, fence);
-
 
938
    mutex_unlock(&rdev->r600_blit.mutex);
-
 
939
 
-
 
940
    r = radeon_fence_wait(fence, false);
-
 
941
 
-
 
942
    write_lock_irqsave(&rdev->fence_drv.lock, irq_flags);
-
 
943
    list_del(&fence->list);
-
 
944
    fence->emited = false;
-
 
945
    fence->signaled = false;
-
 
946
    write_unlock_irqrestore(&rdev->fence_drv.lock, irq_flags);
-
 
947
 
928
    mutex_unlock(&rdev->r600_blit.mutex);
948
    return r;
Line 929... Line 949...
929
};
949
};
930
 
950
 
931
int r600_create_video(int w, int h, u32_t *outp)
951
int r600_create_video(int w, int h, u32_t *outp)
Line 963... Line 983...
963
 
983
 
964
    ((uint64_t*)outp)[0] = saddr;
984
    ((uint64_t*)outp)[0] = saddr;
965
    outp[2] = uaddr;
985
    outp[2] = uaddr;
Line 966... Line 986...
966
    outp[3] = pitch;
986
    outp[3] = pitch;
967
 
987
 
968
    dbgprintf("Create video surface %x, mapped at %x pitch %d\n",
988
//    dbgprintf("Create video surface %x, mapped at %x pitch %d\n",
Line 969... Line 989...
969
              (uint32_t)saddr, uaddr, pitch);
989
//              (uint32_t)saddr, uaddr, pitch);
970
    return 0;
990
    return 0;
971
 
991