The passive construction to which you're referring is usually called pasiva refleja ("reflexive passive [voice]"), because of the use of the reflexive pronoun se.
The passive form that would correspond to «Se lo di» would be
Se le dio.
What's happening here? The passive voice shifts the arguments of the verb. The subject is deleted and the direct object is promoted to subject. The indirect object, if there is one, stays the same.
In this case, the pronoun se in «Se lo di» is the indirect object. It refers to the third person singular, and it should be le, but there's a grammar rule that says that when both le (indirect object) and lo (direct object) appear in a proposition, then le turns into se.note
In order to turn this into a passive with se, you do the following:
- Delete the subject. This is easy in your sentence, since the subject is already implicit (yo).
- Promote the direct object to subject. In «Se lo di» the subject is lo, a third person singular masculine pronoun. When you make it the subject, you delete it (as is usual in Spanish): lo → ello → ∅, but you must turn the verb into its third person singular form: di → dio.
- You keep the indirect object, but since there is no more direct object the rule above doesn't hold, so se reverts to its "normal" form: se → le.
- You add se to make this a pasiva refleja.
You might be wondering what happened to the first person singular implied in the original sentence («Yo se lo di»). In this kind of passive construction that information is lost; you cannot re-introduce it. This is different from what happens with the other type of passive, the so-called periphrastic passive voice, which is more like the English passive voice.
Note: The rule actually says that the indirect object pronouns le and les both change to se when a direct object pronoun (one of la, lo, las, los) is present in the proposition. So this whole answer also holds for «Se la di», «Se las di» and Se los di; and when making the change into passive, se could also turn into les (there's no way to know where the recipient of the action is singular or plural, because se is ambiguous).