It seems your struggling with the context.
The prophecy - future of David:
As David wrote, “He (Jesus) asked life of You (God), and You (God) gave it to him, length of days forever and ever” (Psalm 21:4).
The prophecy being fulfilled "in" the Life and Ministry of Jesus
Jesus affirmed, “The Father has granted the Son to have life in himself” (John 5:26).
The authority God gave Jesus speaking of a future event:
John 10:18 “No one takes it from me, but I lay it down of my own accord. I have authority to lay it down, and I have authority to take it up again. This charge I have received from my Father.”
And now the Gospel with Power as recorded by Paul
Romans 1:1–4 Paul, a servant of Christ Jesus, called to be an apostle, set apart for the gospel of God, 2 which he promised beforehand through his prophets in the holy Scriptures, 3 concerning his Son, who was descended from David according to the flesh
4 and was declared to be the Son of God in power according to the Spirit of holiness by his resurrection from the dead, Jesus Christ our Lord.
Don't reply with more empty and meaningless waffle!
Read the Word with more care.